在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:pranavpr/koa2-es2017-api-boilerplate开源软件地址:https://github.com/pranavpr/koa2-es2017-api-boilerplate开源编程语言:JavaScript 100.0%开源软件介绍:Rest API boilerplate using Koa2 & ES2017A mostly unopinionated starter project for creating RESTful APIs using Koa2 and ES2017+ features in a Node.js server environment as well as providing linting and testing support. It provides the setup for compiling, linting and testing your code but doesn't make any further assumptions on how your project should be structured. Make sure you read the FAQ for more details and info. Features:
Getting started# Clone the project
git clone [email protected]:pranavpr/koa2-es2017-api-boilerplate.git
cd koa2-es2017-api-boilerplate
# Make it yours
rm -rf .git && git init && npm init
# Install dependencies
npm install
# or if you're using Yarn
yarn If you don't use Yarn you can just replace Then you can begin development: yarn run dev This will launch a nodemon process for automatic server restarts when your code changes. TestingTesting is powered by Jest. This project also uses supertest for demonstrating a simple routing smoke test suite. Feel free to remove supertest entirely if you don't wish to use it. Start the test runner in watch mode with: yarn test You can also generate coverage with: yarn test --coverage LintingLinting is set up using ESLint. It uses ESLint's default eslint:recommended rules. Feel free to use your own rules and/or extend another popular linting config (e.g. airbnb's or standard). Begin linting in watch mode with: yarn run lint Environmental variables in developmentThe project uses dotenv for setting environmental variables during development. Simply copy It is strongly recommended never to check in your .env file to version control. It should only include environment-specific values such as database passwords or API keys used in development. Your production env variables should be different and be set differently depending on your hosting solution. DeploymentDeployment is specific to hosting platform/provider but generally: yarn run build will compile your src into yarn start will run The last command is generally what most hosting providers use to start your application when deployed, so it should take care of everything. FAQWhere is all the configuration for ESLint, Jest and Babel? In Why are you using
In order to avoid such confusions, LicenseMIT License. See the LICENSE file. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论