Getting started
Setting up the web server

Overview

The SugoiJS server module provides express based web server, thanks to inversify-express-utils.
This module contain utils for singleton services, request handling decorators, request policies and authorization policies decorators.
This module helps you define microservices by using module based architecture.

Installation

@sugoi/cli

Check the get started section and jump directly to "Define a route" section

Manually

npm install --save @sugoi/server

tsconfig.json:

Under your tsconfig - compilerOptions set:
  • "target": "es2015"
  • "emitDecoratorMetadata": true
  • "experimentalDecorators": true
  • "lib": ["es2015","dom"]
Template
You can use the config template that was set for the @sugoi/demo application:
1
{
2
"compilerOptions": {
3
"baseUrl": "./src",
4
"allowJs": true,
5
"target": "es2015",
6
"module": "commonjs",
7
"moduleResolution": "node",
8
"sourceMap": true,
9
"emitDecoratorMetadata": true,
10
"experimentalDecorators": true,
11
"lib": [
12
"es2015",
13
"dom"
14
],
15
"typeRoots": [
16
"./node_modules/@types"
17
],
18
"types": [
19
"body-parser",
20
"express",
21
"node"
22
]
23
}
24
}
Copied!
Last modified 2yr ago