Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Dwigoric/unboundmnl-area-2-server

Repository files navigation

UnboundMNL - Problem Area #2 (Server)

This is the server side of the UnboundMNL Problem Area #2. The project presents a simple REST API, exposing endpoints for the client to use. This is built using NodeJS and ExpressJS.

Recommended: Install Yarn Berry

  1. Install Node.js 14+
  2. Open a terminal on your user directory.
  3. Run corepack enable
  4. Run yarn set version stable

Environment Variables

Duplicate .env.example and rename it to .env.

PORT

The port to use for the application, defaults to 3000.

MONGODB_URI

The MongoDB URI to use for the application, defaults to mongodb://localhost:27017/unboundmnl-problem-area-2.

JWT_SECRET

The secret to use for JWT. This is required for the application to run. If not set, the application will throw an error.

FRONTEND_URLS

The comma-separated list of URLs of the frontend application. This is used for CORS. If no value is set, the application will allow all origins.

Private Files

Put any private files in the private directory. This route is protected by .gitignore and will not be committed to the repository. Put here the template application form and other private files.

Optional Development Stuff

Prettier for Code Formatting

You can install the Prettier - Code formatter extension (for VSCode). Other editors have their own extensions as well. Rules are already set in .prettierrc.json.

ESLint for Code Linting

You can install the ESLint extension (for VSCode). Other editors have their own extensions as well. Rules are already set in .eslintrc.js.

Project Setup

yarn

Start the Server

yarn start

Automatically Restart the Server on Changes

yarn watch

About

This repository contains the source code for Unbound MNL (Problem Area #2) server.

Resources

License

Stars

Watchers

Forks

Languages