This is an ExpressJS REST API that uses Prisma to connect to a Postgres database and CRUD blog.
- Prisma
- Express
- Postgres
- TypeScript
- Jsonwebtoken
- Marked
- Node-cron
- Radis
- Install dependencies
yarn
- Provision a Postgres container on Railway
- Connect to your Railway project with
railway link
- Migrate the database
railway run yarn migrate:dev
- Run the Server app
railway run yarn dev
This is a simple REST API for blog items. The available routes are
POST /users/login
Authenticate and log in a user *POST /users/logout
Log out the current user *POST /users/refresh-token
Refresh the authentication token *
POST /users
Register a new user using the provided data in the JSON body *GET /users
Get a list of all usersGET /users/:id
Get details of a user specified by theid
PATCH /users/:id
Update the details of a user specified by theid
DELETE /users/:id
Delete a user specified by theid
GET /articles:id
Get a specific article by itsid
*GET /users/:userId/articles
Get all articles authored by a user specified byuserId
*POST /articles
Create a new article with the provided data in the JSON body. Optionally, attach an image or provide an image URLGET /articles/
Get a list of all articles.PATCH /articles/:id
Update the details of an article specified by theid
DELETE /articles/:id
Delete an article specified by theid
*
Don't require authentication on the route.