3.1.1 • Published 5 years ago
express-api-bootstrap v3.1.1
express-api-bootstrap
express-api-bootstrap
makes it easy to create stand-alone, production-grade express based Applications that you can just run
.
Quick Start
# create a new directory for your app
mkdir test-boot-app
cd test-boot-app
# Generate package.json without any question
npm init -y
# add required dependencies use yarn
yarn add express-api-bootstrap
# add required dependencies use npm
npm i express-api-bootstrap --save
# init express-api-bootstrap required env
npx boot init
Open and modify package.json
with following section:
{
"scripts": {
"start": "boot dev",
"build": "boot build",
"serve": "boot serve",
"test": "boot test"
}
}
Create the first controller at src/controllers/helloController.ts
with following code:
import { HttpRequest, RestController, GetMapping } from 'express-api-bootstrap'
@RestController()
class HelloControler {
@GetMapping('/hello')
async sayHello(req: HttpRequest) {
return {
hi: req.query.name
}
}
}
export default HelloControler
Run yarn start
to, and you will see the first API at http://localhost:8080/apis/hello
Want to contribute?
see contributing
LICENSE
3.1.1
5 years ago
3.0.8
5 years ago
3.0.7
5 years ago
3.0.6
5 years ago
3.0.5
5 years ago
3.0.4
5 years ago
3.0.3
5 years ago
3.0.2
5 years ago
3.0.1
5 years ago
3.0.0
5 years ago
2.1.0
6 years ago
2.0.11
6 years ago
2.0.10
6 years ago
2.0.9
6 years ago
2.0.8
6 years ago
2.0.7
6 years ago
2.0.6
6 years ago
2.0.5
6 years ago
2.0.4
6 years ago
2.0.3
6 years ago
2.0.2
6 years ago
2.0.1
6 years ago
2.0.0
6 years ago