1.3.12 • Published 1 year ago
@cilinder/generate-node-backend v1.3.12
generate-node-backend
Simple Node.js program to generate a backend using Node.js, Express, Prisma, TSOA.
Usage
First install Node.js
Initialize package.json
npm initAfter answering the questions, install the package
npm install @cilinder/generate-node-backend --save-devInitialize the project
npx gnb initCreate a test route
npx gnb generate-test-routeGenerate an API route and all the associated code
npx gnb generate-route <name of the controller generated> <the route for the API> <"Get" or "Post">You can use the dry-run option with any command to see the files it would generate without writing anything to disk.
Generate a test route and view the Swagger GUI
Generate the test route
npx gnb generate-test-routeStart the backend
npm run devThe project is available at localhost:$PORT/docs, where $PORT can be found in .env (the port is generated randomly for each new instance).