Simple template with support for MongoDB and Passport.
This template gives you a fundation for developing REST APIs. The Project shoud help you getting started by providing a foundation on which you can extend.
-
Express server setup for APIs
-
MongoDB connection
-
Basic user management
-
Input validation
Simply download the latest release from https://github.com/Xenira/ts-express-template/releases. Extract the archive and run yarn install
or npm install
from within the extracted folder.
yarn start
or npm start
yarn build
or npm build
The folder structure is as follows:
Folder | Content | Files |
---|---|---|
./src |
Application source directory |
|
|
||
./src/config |
Helper objects and Middleware |
|
|
||
|
||
./src/controllers |
Logic that is called from the router |
|
|
||
./src/models |
MongoDB connection and models |
|
|
||
./src/routes |
Routes that can be importet in app.ts and call the controller logic |
|
|
||
./src/public |
Staticly accessable files |
--- |
./sslcert |
Place your certificates here |
--- |
./config.json |
Database and other config can be put here |
--- |
./dist |
Compiled JavaScript files (Only exists after build) |
--- |