git clone [email protected]:macajind/typescript-api-project-foundation.git
npm install
npm watch # or npm watch-debug
-
Change project name, version, licence etc. in the
package.json
file. -
Create
.env
file from the example with the specific configuration for your project. -
Install any other required libraries for your project using
npm
and don't forget about theirs TypeScript parts.
Project uses traditional API architecture with two layers (models and controllers) and JSON format as output. It disposes with powerful, but lightweight implementation of basic annotations known from other frameworks and languages, that can really help you with your project development.
-
Place your controllers so mapping defined in your
.env
can find them. And inherit fromController
class to provide them with helpful features. -
Use
@Inject
annotation in your classes on properties and constructors to automatically get instances your services by using design pattern Dependency Injection. -
Use
@Route
annotation for easy mapping of controller methods to specific URLs by using standard Express routing and combine it directly with input data validation through Express validator.