当前位置: 首页 > 软件库 > Web应用开发 > >

typescript-express-rest-api

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 澹台星剑
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Node.js Express API with TypeScript 3

Node.js Express API with TypeScript 3. Supports MongoDB

Description

This skeleton will help you to build your own Node.js Express Mongodb API using TypeScript 3.

Project Introduction

Features

Authentication:
  • jwt authentication
Session Storage:
  • MongoDB
Integration testing
  • mocha
  • chai
  • supertest

Requirements

  • node >= 10
  • npm >= 6
  • mongodb >= 3.0
  • typescript >= 3.0

Running the API

Development

To start the application in development mode, run:

npm install

Start the application in dev env:

npm run dev

Start the application in production env:

Install ts pm2 and typescript compiler:

npm install -g pm2
pm2 install typescript

example start with scale on 2 core:

pm2 start ./src/index.ts -i 2 --no-daemon

or

npm run build
pm2 start ./build/index.js

Express server listening on http://localhost:3000/, in development modeThe developer mode will watch your changes then will transpile the TypeScript code and re-run the node application automatically.

Testing

To run integration tests:

npm test

Set up environment

In root folder you can find .env. You can use this config or change it for your purposes.If you want to add some new variables, you also need to add them to interface and config object (Look src/config/index.ts)

Swagger

npm install -g swagger-jsdoc
swagger-jsdoc -d swaggerDef.js -o swagger.json

Swagger documentation will be available on route:

http://localhost:3000/docs
 相关资料
  • Hey There! �� �� that ⭐️ button if you like this boilerplate. A boilerplate for Node.js App. This boilerplate is built using Express.js web framework, and is using Typescript Lang for writing the app'

  • express-react-typescript A boilerplate to build web application using Express and React with help of Typescript. It's configured to separate client-side JavaScript and CSS bundles and your files as as

  • Introduction Easily bootstrap your Typescript project with NodeJS + Express + Sequelize ORM. ❤️ Installation Run one of the command below npm install npm install -g yarnyarn The build tasks use Gulp t

  • API RESTful em Express, Mongoose, Mocha e Chai. Scripts Os seguintes scripts estão disponiveis com yarn run SCRIPT ou npm run SCRIPT Script Descrição test Roda o linter, roda os testes unitários e os

  • Express TypeScript Boilerplate This repo can be used as a starting point for backend development with Nodejs. It comes bundled with Docker and is CI/CD optimized. The development environment uses dock

  • express-graphql-typescript-boilerplate A GraphQL starter kit for building amazing API's in TypeScript and with Express.js framework. This seed repository has a complete GraphQL starter kit written in