Express REST API Starter Package: Essential NPM Package for Kickstarting REST API Development { JS / TS }
npx create-api-starter@latest
Features | JS | TS |
---|---|---|
Language Support | ✔️ | ✔️ |
Scaffold Anywhere | ✔️ | ✔️ |
Initialize Git | ✔️ | ✔️ |
Import Statement | ✔️ | ✔️ |
Custom Favicon | ✔️ | ✔️ |
Logging | ✔️ | ✔️ |
Rate Limiting | ✔️ | ✔️ |
Custom Error Handling | ✔️ | ✔️ |
Nodemon Support | ✔️ | ✔️ |
Serve public files |
✔️ | ✔️ |
Barrel Export | ✔️ | ✔️ |
Linting Support | ✔️ | ✔️ |
API Versioning | ✔️ | ✔️ |
Simple Folder Structure | ✔️ | ✔️ |
Highly Customizable | ✔️ | ✔️ |
Inside of your create-api-starter
project, you'll see the following folders and files:
.
├── .babelrc
├── .env
├── .eslintrc.json
├── .gitignore
├── README.md
├── package-lock.json
├── package.json
└── src
├── app.js
├── public
│ └── favicon.ico
└── v1
├── config
│ └── env.config.js
├── controllers
│ ├── Default.controller.js
│ └── index.js
├── middlewares
│ ├── Default.middleware.js
│ └── index.js
└── routes
├── Default.route.js
└── index.js
.
├── .env
├── .eslintrc.json
├── .gitignore
├── README.md
├── package-lock.json
├── package.json
├── src
│ ├── app.ts
│ ├── public
│ │ └── favicon.ico
│ ├── types
│ │ └── index.d.ts
│ └── v1
│ ├── config
│ │ └── env.config.ts
│ ├── controllers
│ │ ├── Default.controller.ts
│ │ └── index.ts
│ ├── middlewares
│ │ ├── Default.middleware.ts
│ │ └── index.ts
│ └── routes
│ ├── Default.route.ts
│ └── index.ts
└── tsconfig.json
Any static assets, like images, can be placed in the src/public/
directory.
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at http://localhost:5000 |
npm run build |
Build your production site to ./build/ |
npm run start |
Preview your build locally, before deploying |
npm run lint |
Shows linting errors |
npm run lint-fix |
Fixes linting errors |