An API that allows users to create an account, add a guinea pig fact, and opt in to receive weekly facts.
- Java 8: if it not already installed follow these Instructions
- MongoDB
- CLI: follow the Installation Guide
- MongoDB Atlas: create an account and follow the Getting Started Guide
- Clone repository: git@github.com:KorynLA/GuineaPigFactsBackend.git
- Update the mongoDB that will be used by the application.
- If using MongoDB Atlas:
- cd /<pwd>/guineaPigFacts/src/main/resources
- Remove all text from application.properties
- Add spring.data.mongodb.uri=<YOUR_URI>
- If using MongoDB Atlas:
- If using MongoDB local
- cd /<pwd>/guineaPigFacts/src/main/resources
- Update application.properties with database name you want to save the data in line 7: spring.data.mongodb.database=<YOUR_DATABASE>
- Have mongoDB instance running
- Locally
- Open a new shell and run the command: mongo
- MongoDB Atlas
- Should already be running. The system status can be checked here
- cd /guineapigfacts
- Run ./mvnw spring-boot:run
- /user/{id}
- GET
- Retrieves user with the ID passed in the URL path
- /user/
- POST
- Adds a user to the User collection
- /user/{id}
- PUT
- Updates a document in the User collection with the ID passed in the URL path
- /user/{id}
- DELETE
- Deletes a document with the ID passed in the URL path
- /fact/
- GET
- Retrieves all facts in the Fact collection
- /fact/{id}
- GET
- Retrieves fact with the ID passed in the URL path
- /fact/
- POST
- Adds a fact to the Fact collection
- /fact/{id}
- DELETE
- Deletes a document with the ID passed in the URL path
Spring Boot with the data loaded to and from a MongoDB Atlas database.