Skip to content

tpf-concurrent-benchmarks/http_js

Repository files navigation

HTTP Server in JavaScript

Objective

This is a JavaScript implementation of an HTTP polls server under common specifications defined for multiple languages.

Deployment

Requirements

Configuration

The following environment variables must be defined in the .env file:

  • APP_PORT: The port of the application.
  • SECRET_KEY: A secret key for encrypting the JWT tokens.
  • SECRET_ALGORITHM: The algorithm used for encrypting the JWT tokens.
  • SECRET_EXPIRE_TIME: The expiration time for the JWT tokens, in a formatted string.
  • POSTGRES_USER: The user for the Postgres database.
  • POSTGRES_PASSWORD: The password for the Postgres database.
  • POSTGRES_HOST: The host for the Postgres database.
  • POSTGRES_PORT: The port for the Postgres database.
  • POSTGRES_DB: The name of the Postgres database.

Example values for every variable can be found in the .env.example file.

You can copy the file and rename it to .env to use it as a base for your configuration:

cp .env.example .env

Commands

Startup

  • make setup: Sets up everything needed for the application to run in Docker Swarm.

Run

  • make deploy: Builds the necessary Docker images and deploys the application to Docker Swarm, alongside with Graphite, Grafana and cAdvisor.
  • make remove: Removes all services created by the deploy command.

Development

  • Postgres DB must be accessible.
  • npm install: Installs the dependencies of the application.
  • make dev: Runs the application in development mode.

Monitoring

Used libraries

  • Express: Web framework for Node.js.
  • Sequelize: Promise-based Node.js ORM for Postgres and other databases.
  • Zod
  • Bcrypt: Library for hashing passwords.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published