- Docker
- NodeJS LTS(14) (If you're using nvm, running
nvm use
after entering the project directory, it will download and use node version specified in.nvmrc
) - yarnpkg (
npm i -g yarn
to install)
- set environment variables
DB_USER
andDB_PASSWORD
to the desired username and password for the Database. - run
docker-compose -f docker-compose-infra.yml up -d
to start the database instance.
- copy the file
.env.example
as.env
and edit it to add the database username and password, and, if needed, change the port on which the application runs on. - run
yarn
to install all the dependencies - run
yarn dev
to start the application (can be accessed onhttp://localhost:8000
, or a different port if changed). The application will restart everytime source code is updated to apply the changes made.
/
GET
: List of all posts/posts/<post_id>
GET
: Post with the givenpost_id
(post_id
is the_id
of a post seen in the above list)/posts
POST
: Create a new posts- requires
title
,author
andcontent
in the request body
- requires