在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:marmelab/javascript-boilerplate开源软件地址:https://github.com/marmelab/javascript-boilerplate开源编程语言:JavaScript 95.3%开源软件介绍:
marmelab-boilerplateA starter kit for new apps, based on:
Features:
The boilerplate contains a sample app with three domains: users, products, and orders. Feel free to remove the corresponding files once you start implementing your own domain. InstallRequirements:
# install npm dependencies and Selenium (for tests)
make install Tip: Add UnderstandThe project directory structure is as follows:
The entire code (api, admin, and frontend) is written in ES6 and transpiled to ES5 by babel. Tip: In production, the compiled JS and CSS files (under The main entry point for understanding the code is probably Project ConfigurationThis projects supports various runtime environments. This means that you can switch to an entirely different configuration based on the # run the API server in development mode (default)
$ node ./src/api/index.js
# run the API server in test mode
$ NODE_ENV=test node ./src/api/index.js
# run the API server in production mode
$ NODE_ENV=production node ./src/api/index.js Tip: On the production servers, you should set the It uses node-config to let you configure the project for the development, test, and production environments. Before running the app in development, you must copy the Note: You need to remove all the demo code before to start your project. A pull request is in progress to do so, but this will take some time to finish it. Meanwhile, take a look on these folders to manually clean the code: DevelopThis project uses pm2 to manage its processes. Configuration files for pm2 can be found in the # start servers (node and webpack via pm2)
make run-dev
# both servers will run in the background
# the Node server uses nodemon and will restart on code change
# the frontend is served by webpack dev server with hot reload
# you can restart either the api or the frontend by hand
make restart-api
make restart-frontend Browse the app:
Tip: You can change the API port by running # stop servers (node and webpack)
make stop-dev Test# tests run in the "test" environment and don't empty the "development" database
make test
# alternatively, you can run any of the individual test suites:
make test-api-unit
make test-api-functional
make test-frontend-unit
make test-frontend-functional
make test-isomorphic-unit API (and common lib) unit tests using: API functional tests using: Frontend unit tests using:
Frontend fonctional tests using: DeploymentManaging servers with PM2dev and tests servers are managed with PM2. So, It's possible to : # display the 'front dev' server's logs
make log-frontend-dev
# display the 'api dev' server's logs
make log-api-dev
# display the list of all servers
make servers-list
# display the monitoring for all servers
make servers-monitoring
# stop all servers
make servers-stop-all
# stop all servers, delete them, and clear their logs.
make servers-clear-all |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论