bme-db-lab / szglab5-backend

Szglab5 Backend Service
3 stars 0 forks source link

szglab5-backend

Git repository for laboradmin backend service

Table of Contents

Prerequisites

You will need the following things properly installed on your computer.

Installation

Clone repository

git clone <repository-url>

Install npm packages

cd szglab5-backend
npm install

Install nodemon (automatic server restart)

npm install nodemon -g

Create database (default is "laboradmin")

psql -U postgres
CREATE DATABASE laboradmin;

Config

Available node environments ('dev' | 'prod' | 'test')

Steps to add specific config:

Commands

CLI (npm run start cli:"ENV" "command")

seed [filepath]
npm run cli:dev seed test1.seed.json

START (npm run start:"ENV")

Starts the API server

npm run start:dev

Endpoints

The endpoints format fit JSON API specification.

Model names in plural (-> modelNamePlural):

Fetching Resources

List (GET /:modelNamePlural)

Creating Resources (POST /:modelNamePlural)

Updating resources (PATCH /:modelNamePlural/:id)

Deleting Resources (DELETE /:modelNamePlural/:id)

Useful links