Skip to content

Latest commit

 

History

History
86 lines (54 loc) · 1.25 KB

File metadata and controls

86 lines (54 loc) · 1.25 KB

Server

The Drawsy server exposes a REST API which the Drawsy client can use to save and load drawings for its gallery. The drawings are stored in a MongoDB database.

The Drawsy server is made with Express.js.

Prerequisites

Setup

Install dependencies

npm install

Create the .env file

  1. Copy the .env.example file to a new .env file.
  2. Edit the .env file with the proper credentials for the MongoDB database.

Usage

Run

Development

npm start

This will start the server with hot-reload for development.

Production

npm run start:prod

This will start the server without hot-reload, for use in production.

Build

Check

npm run build:check

This will check that the TypeScript code can successfully compile for type-checking, but will not emit any compiler output.

Docker image

# Build context needs to be the project's root directory
docker build -t drawsy/server -f Dockerfile ..

This will build the Docker image which is used in production.

Test

npm test

Code coverage

npm run coverage

Lint

npm run lint

Format

npm run format