Skip to content

ditsmod/seed

Repository files navigation

Description

This is Ditsmod seeds.

Usage

From first terminal:

git clone --depth 1 https://github.com/ditsmod/seed.git my-app
cd my-app
npm i

Start in development mode:

# From first terminal.
# This compiles TS to JS.
npm run watch

# From second terminal.
# This starts the web server and restarts when changes are made.
npm start

Start in production mode:

npm run build
npm run start-prod

From second terminal, check work:

curl -i localhost:3000/api/hello
curl -i localhost:3000/api/throw-error
curl -i localhost:3000/api/body -d '{"one":1}' -H 'content-type: application/json'

# Use controller as singleton
curl -i localhost:3000/api/hello2
curl -i localhost:3000/api/throw-error2
curl -i localhost:3000/api/body2 -d '{"one":1}' -H 'content-type: application/json'

Example

You can see more example usage in ditsmod repository