An open API service indexing awesome lists of open source software.

https://github.com/nda17/node-express-server

Node-express-server
https://github.com/nda17/node-express-server

colors compression cors dotenv express-js helmet jest morgan node-js prisma supertest ts-node-dev tsconfig-paths typescript zod-validation

Last synced: 6 days ago
JSON representation

Node-express-server

Awesome Lists containing this project

README

          

# «Node-express-server»

## _Implementation features:_

Node.js server with implementation using the Express.js framework.
Interaction with the Postgres database is carried out through Prisma (ORM).

## _The project implements the "Publication" entity._

## _The following queries were created:_

- [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_

---

## _Testing:_

Added unit tests (Jest) for testing CREATE and PUT requests

---

## _Used stack:_

- [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

---

## _Database:_

- [V] PostgreSQL

---

## _Adding personal settings to the .env environment variable:_

- 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

---

## _Compiles and minifies for production:_

- pnpm run build
- npm run build

---

## _Getting started online development server:_

- pnpm run dev
- npm run dev

---

## _Running unit tests:_

- pnpm run test
- npm run test