Skip to content

codebench-dev/api

Repository files navigation

codebench-api

The CodeBench main API.

Requirements

  • NodeJS v16+
  • PostgreSQL (cf docker-compose.yml)

Run API

Dev with hot-reloading:

npm run dev

Prod:

npm start

Manage database with TypeORM

Delete schema:

npm run db:drop

Run all migrations:

npm run db:migrate

Reset db (combination of drop and migrate)

npm run db:reset
npm run typeorm migration:generate -- -n xxx

Create migration:

# After editing or adding an Entity
npm run typeorm migration:generate -- -n AddNewEntity

Style

Available commands for eslint/prettier:

npm run lint:check
npm run lint:fix
npm run format:check
npm run format:fix