Node.js server with implementation using the Express.js framework. Interaction with the Postgres database is carried out through Prisma (ORM).
-
[GET] Request to get all "Publication" entities from the database
-
[GET] Request to obtain a specific entity from the database by its "id"
-
[CREATE] Request to create the entity "Publication" in the database with the properties "id", "createdAt", "updatedAt", "title", "description"
-
[PUT] Request to update entity properties by "id" in the database
-
[DELETE] Request to delete an entity by "id" from the database
Added unit tests (Jest) for testing CREATE and PUT requests
- [V] Express.js
- [V] Typescript
- [V] Ts-node-dev
- [V] Prisma
- [V] Helmet
- [V] Morgan
- [V] Zod
- [V] Dotenv
- [V] Compression
- [V] Jest
- [V] Supertest
- [V] PostgreSQL
- PORT = 4200
DEVELOPMENT mode or PRODUCTION mode (select one mode):
- NODE_ENV = production
- NODE_ENV = development
Path to database:
- DATABASE_URL = postgresql://postgres:postgres@localhost:5432/blog?schema=public
- pnpm run build
- npm run build
- pnpm run dev
- npm run dev
- pnpm run test
- npm run test