项目
在 GitHub 查看
benawad/create-graphql-api
关于
Set up a Typescript GraphQL API by running one command.
开发工具实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文create-graphql-api
npx create-graphql-api my-api
cd my-api
npm start
Example
Basic: https://www.youtube.com/watch?v=WhzIjYQmWvs
Auth: https://www.youtube.com/watch?v=OVdPOExxKuU
Templates
You can do the following for an auth template:
npx create-graphql-api my-api --auth
How to Deploy to Heroku
- Make sure you have Git setup
- Setup Heroku CLI: https://devcenter.heroku.com/articles/getting-started-with-nodejs#set-up
- Create a
Procfilein the root folder of your project and put the following in it:
web: node dist/index.js
- In your
package.jsonadd the following script to run the TypeScript compiler before Heroku runs your project:
"heroku-postbuild": "tsc"
- In the root folder of your project, use the Heroku CLI to create a new project:
heroku create
- Add a PostgreSQL database addon
heroku addons:create heroku-postgresql
- Commit your code and push to Heroku
git push heroku master
Note: You'll want to look at your ormconfig.js and configure the options you want for production.
Also see this video on how you can deploy to Digital Ocean with Dokku: https://www.youtube.com/watch?v=AdHwBKKQHZ4
探索相关项目
加载中…