A lightweight node application with 2 servers for the FrontEnd and Backend.
-
Typescript
-
NodeJs and Express
-
JWT Authentication
-
AMD/CommonJS
-
MongoDB and Mongoose
-
HTML Client server
-
CRUD operations example with Mongoose
-
Sourcemaps
-
Cross domain request supported (CORS)
-
Gulp
-
Typings
-
BrowserSync for SCSS
-
Automatic Build + Release
-
Visual Studio Code Debug
- Dependency Inversion (IoC) : http://inversify.io
- run
npm install
- run
gulp start
(you can add -port:4242 to start the server on a specific port)
- run
gulp build:dev
- start
DEBUG: gulp build:dev
in VSCode Debug tab (ctrl + shift + D)
CommonJS provide a simple require output with multiple js files and their associated source maps.
- run
gulp start:dev
OR
- run
gulp build:dev
- run
node .bin/server.js
AMD concatenates your entire app into a single file (server.js
).
- run
gulp start:release
OR
- run
gulp build:release
- run
node .bin/app.js
-port
to specify a unique port for both the REST and CLIENT servers.-port-rest:3000
to specify the port used by the REST Server.-port-web:3000
to specify the port used by the CLIENT Server.
When you first use the project, a http request is considered as a request with an authenticated user if headers contain a Authorization
with the value Bearer authenticated
.
To add your custom authentication logic you can simply modify the auth.ts
verifyBearerToken
to implement your own authentication mechanism.