【文件属性】:
文件名称:express-mongoose-template:具有express,mongoose和TypeScript的模板Node.js项目
文件大小:2.3MB
文件格式:ZIP
更新时间:2021-02-03 13:44:51
nodejs template express typescript mongoose
表达猫鼬模板
快速开始
开始开发...
您需要首先创建一个.env文件并配置数据库,然后设置数据库并开始开发/测试。
# install deps
yarn install
# run in development mode
yarn dev
# run tests
yarn test
# check code styles
yarn lint
# check type errors
yarn typecheck
安装依赖项
安装所有程序包依赖项(一次操作)
yarn install
运行
在开发模式下运行:
运行应用程序是开发模式。 不应在生产中使用
yarn dev
或调试
yarn dev:debug
在生产模式下运行:
编译应用程序并以生产模式启动
yarn compile
yarn start
测试一下
运行摩卡单元测试
yarn test
或调试它们
yarn test:debug
运行测试并在./test/test-results.xml输出JUnit样式的XML测试结果文件
yarn test:junit
试试吧
确保数据库正在运行
打开浏览器到
调用
【文件预览】:
express-mongoose-template-master
----build.ts(287B)
----.gitignore(177B)
----.env.example(289B)
----package.json(2KB)
----server()
--------api()
--------index.ts(634B)
--------routes.ts(209B)
--------common()
----.cfignore(139B)
----public()
--------api-explorer()
--------index.html(312B)
----tsconfig.json(331B)
----.github()
--------workflows()
----.eslintrc.js(959B)
----.prettierrc.js(86B)
----README.md(3KB)
----.vscode()
--------launch.json(906B)
----.mocharc.yaml(87B)
----nodemon.json(181B)
----test()
--------setup.ts(265B)
--------examples.controller.ts(785B)
----yarn.lock(148KB)
----.dependabot()
--------config.yml(211B)