Typescript base REST API module
This is a lightweight annotation-based restify extension for typescript.
Installation:
This library only works with typescript. Ensure it is installed:
npm install typescript -g
To install typescript base rest api:
npm i typescript_base_rest_api
Get started
1. Define a service router
2. Create a service
3. Configure your server
.withNameconfig.get"server.options.name" .withVersionconfig.get"server.options.version" .build; .withTimeoutconfig.get"server.options.timeout" .withOptionsoptions .withQueryParserqueryParser .withRouternew PingRouter .withRouternew ItemRouter .withCORSfalse .build; ; server.listenport, ;
4. Run your application!
The API will be running at http://localhost:8282
Configure your application
You can configure your application using environment variables. Example:
Examples
Check examples folder to see some basic usage.
Development
To use lint in development, you need to install typescript and tslist globally:
npm install -g typescript tslint