DEV Community

Jorge Augusto Rodriguez
Jorge Augusto Rodriguez

Posted on

Basic template for creating an API project with node/typescript/swagger

Getting Started

Clone the repository and install the dependencies.

git clone https://github.com/jsalio/ExpressWebApiTemplate
cd ExpressWebApiTemplate
pnpm install
Enter fullscreen mode Exit fullscreen mode

Prerequisites

Folder structure

├── README.md
├── package.json
├── lib
│   ├── app.ts
│   ├── server.ts
│   ├── app-router.ts # App router
│   ├── controllers # Controllers
│   │   ├── HomeController.ts
│   ├── models
│   │   ├── Response.ts
├── Public
│   ├── swagger.json # Swagger file (autogenerated)
├── nodemon.json
├── tsconfig.json
├── tsoa.json
├── tslint.json
Enter fullscreen mode Exit fullscreen mode

How to run

  • For build and run the project

    pnpm run start:dev
    
  • For update swagger file

    pnpm run swagger
    
  • For run in watch mode

    pnpm run start
    

Top comments (1)

Collapse
 
3p1l profile image
LMugget • Edited

The link to the repository is broken and the commands are outdated, follow the updated instructions below:

git clone github.com/jsalio/BasicExpressTemp...
cd BasicExpressTemplateTypeScript2
npm i