GeordiD / gen-node-server

A scaffolded node server intended to be the starting point for future projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gen-node-server

A scaffolded node server meant to be a starting point for new projects

Quick Start

Get started developing...

# install deps
pnpm install

# run in development mode
pnpm run dev

# run tests
pnpm run test

How do I modify the example API and make it my own?

There are two key files:

  1. server/routes.ts - This references the implementation of all of your routes. Add as many routes as you like and point each route your express handler functions.
  2. server/common/api.yaml - This file contains your OpenAPI spec. Describe your API here. It's recommended that you to declare any and all validation logic in this YAML. express-no-stress-typescript uses express-openapi-validator to automatically handle all API validation based on what you've defined in the spec.

Install Dependencies

Install all package dependencies (one time operation)

npm install

Run It

Run in development mode:

Runs the application is development mode. Should not be used in production

npm run dev

or debug it

npm run dev:debug

Run in production mode:

Compiles the application and starts it in production production mode.

npm run compile
npm start

Test It

Run the Mocha unit tests

npm test

or debug them

npm run test:debug

Try It

  • Open your browser to http://localhost:3000
  • Invoke the /examples endpoint
    curl http://localhost:3000/api/v1/examples

Debug It

Debug the server:

npm run dev:debug

Debug Tests

npm run test:debug

Debug with VSCode

Add these contents to your .vscode/launch.json file

About

A scaffolded node server intended to be the starting point for future projects


Languages

Language:TypeScript 85.6%Language:JavaScript 10.2%Language:Dockerfile 2.5%Language:HTML 1.7%