express-no-stressを使って、Expressを使用したREST-APIの作成サンプル。
express-no-stress
動作確認まで。
ts版があるようなので、実際の実装を試すのはts版で実施する。
Get started developing...
# install deps
npm install
# run in development mode
npm run dev
# run tests
npm run testInstall all package dependencies (one time operation)
npm installRuns the application is development mode. Should not be used in production
npm run devor debug it
npm run dev:debugCompiles the application and starts it in production production mode.
npm run compile
npm startRun the Mocha unit tests
npm testor debug them
npm run test:debug- Open you're browser to http://localhost:3000
- Invoke the
/examplesendpointcurl http://localhost:3000/api/v1/examples
npm run dev:debug
npm run test:debug
Add these contents to your .vscode/launch.json file
View airbnb linter output
npm run lint
Fix all airbnb linter errors
npm run lint
Deploy to CloudFoundry
cf push express-rest-sampleAPP_ID=express-rest-sample
PORT=3000
LOG_LEVEL=debug
REQUEST_LIMIT=100kb
SESSION_SECRET=mySecret
#Swagger
SWAGGER_API_SPEC=/spec