Sign inSign up

bankierubybank/nodejs-express

By bankierubybank

•Updated about 2 years ago

For learning how to develop an application with cloud-native ready.

Image
0

5.2K

bankierubybank/nodejs-express repository overview

⁠My Nodejs Express Sample API

This project is for learning Nodejs (Express and Pug)

⁠Setup
docker build -t nodejs-express:latest .
docker run --name nodejs-express -d -e DBHOST="your-database-host" -e DBPASS="your-database-password" -e DBNAME="mydb" -p 80:8080 nodejs-express:latest
⁠Docker Compose

Build and run from source

docker compose up -d --build

Run from built image

docker compose up -d
⁠Environment Variable
Variable nameDescriptionDefaultMandatory
PORTApplication Port8080YES
DBHOSTDatabase IP/HostnamelocalhostYES
DBPORTDatabase Port5432YES
DBUSERDatabase UsernamepostgresYES
DBPASSDatabase PasswordpostgresYES
DBNAMEDatabase NamepostgresYES
POD_NAMEPod NameunsetNO
NAMESPACENamespaceunsetNO
NODENAMENode NameunsetNO
⁠Landing Page
http://<container-ip>
⁠Metrics (Prometheus)
http://<container-ip>/metrics
⁠API Routes (Swagger)
http://<container-ip>/api/v1
⁠Node.js Module
Module NameSourceDescription
expressexpress⁠Create REST Server
pugpug⁠Template Engine
corscors⁠Enable CORS in Node.js
morganmorgan⁠HTTP Request Logger
helmethelmet⁠Middleware for more Security
compressioncompression⁠Compress Response's Body
pgpg⁠PostgreSQL Connector
axiosaxios⁠HTTP Client for Node.js
prom-clientprom-client⁠Prometheus client for Node.js
⁠JS Style Guide

Strict to Google JS Style Guide: https://google.github.io/styleguide/jsguide.html⁠ with eslint⁠.

Conventional Commit⁠

Tag summary

Content type

Image

Digest

sha256:da3304616…

Size

93.7 MB

Last updated

about 2 years ago

docker pull bankierubybank/nodejs-express