【文件属性】:
文件名称:bulletproof-nodejs:防弹node.js API的实现:shield_selector:
文件大小:124KB
文件格式:ZIP
更新时间:2021-02-03 11:06:51
nodejs javascript boilerplate express node
防弹Node.js架构 :shield_selector:
这是博客文章的示例存储库
请阅读博客文章,以更好地了解服务器体系结构。
另外,我在代码中添加了很多不在博客文章中的注释,因为它们解释了实现的原因以及选择库的原因以及一些个人见解和一些恶作剧。
API本身没有任何花哨的功能,它只是具有身份验证功能的用户CRUD。 也许我们可以将其转换为有用的,更高级的示例,只需打开一个问题,然后讨论回购的未来。
发展历程
我们使用node版本14.9.0
nvm install 14.9.0
nvm use 14.9.0
第一次,您将需要运行
npm install
然后只需使用以下命令启动服务器
npm run start
它使用nodemon进行livereloading:peing-fingers:
在线一键设置
您可以将Gitpod用于一键在线设置。 只需单击一下,它将自动启动工作区:
克隆bulletproof-nodejs库。
安装依赖项。
运行cp .env.example .env 。
运行npm run start 。
API验证
通过使用Celebrate,r
【文件预览】:
bulletproof-nodejs-master
----.env.example(324B)
----.eslintrc.js(987B)
----src()
--------app.ts(826B)
--------services()
--------models()
--------subscribers()
--------decorators()
--------types()
--------config()
--------jobs()
--------interfaces()
--------api()
--------loaders()
----.circleci()
--------config.yml(401B)
----.gitpod.yml(315B)
----.prettierrc.json(132B)
----tsconfig.json(640B)
----LICENSE(1KB)
----jest.config.js(6KB)
----Procfile(22B)
----README.md(4KB)
----nodemon.json(159B)
----.editorconfig(196B)
----tests()
--------sample.test.ts(103B)
--------services()
--------.gitkeep(0B)
----.gitpod.Dockerfile(245B)
----.gitignore(193B)
----.eslintignore(9B)
----package-lock.json(385KB)
----package.json(2KB)