Junior — Middle
What components or modules did you add or configure in your last project?
sobes.tech AI
Answer from AI
In my latest Java project, I added and configured the following components:
- Spring Boot for simplifying configuration and application startup.
- Spring Security for implementing user authentication and authorization.
- Hibernate (JPA) for database interaction through ORM.
- REST API using Spring MVC for frontend interaction.
- Swagger for API documentation.
- Maven for dependency management and project build.
For example, to configure Spring Security, I added a configuration class:
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable()
.authorizeRequests()
.antMatchers("/api/public/**").permitAll()
.anyRequest().authenticated()
.and()
.httpBasic();
}
}
This allowed me to secure the API and set up basic authentication.