API Express Blog
This project aims to create a backend with a restful api which can be consumed by different frontends.
- Clone project locally e.g. via ssh.
git clone git@github.com:DavidMatalik/express-api-blog.git
- Install dependencies.
npm i
-
Setup your own mongo DB, e.g. through following these instructions.
-
Create a .env file in the root of your project. Put there the link of your mongoDB. If you followed instructions from point 3, you can get the link from point 10 - 12. The entry should have the following format.
MONGODB_URI='mongodb+srv://<username>:<password>@cluster0.l45nfrv.mongodb.net/?retryWrites=true&w=majority'
- Start the server.
npm run serverstart
- Test your app via curl or e.g. postman.
# GET REQUEST
http://localhost:3000/posts