Proof of concept (#6)
* Sample template created * added findByName functionality for item * Solve Cors errors and inhibit DefaultExposure * changed project structure * Added frontend * Creation of base template (#1) * changed base path of REST api and updated frontend api quering
This commit is contained in:
19
backend/src/main/whattocook/configs/RepositoryConfig.java
Normal file
19
backend/src/main/whattocook/configs/RepositoryConfig.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package whattocook.configs;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
|
||||
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import whattocook.models.Item;
|
||||
|
||||
@Configuration
|
||||
class RepositoryConfig implements RepositoryRestConfigurer {
|
||||
|
||||
@Override
|
||||
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {
|
||||
config.exposeIdsFor(Item.class);
|
||||
config.setBasePath("/api/v1");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user