We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi Guys, I've tried to deploy the json-graphql-server to Heroku, but, I'm still not able to do do.
I'm getting npm ERR! missing script: start
npm ERR! missing script: start
Can you please guide me on the correct way to configure the Heroku Procfile or package.json to properly getting the server running on Heroku?
Procfile
package.json
Thanks a lot.
The text was updated successfully, but these errors were encountered:
Guys, I managed to solve the issues to deploy successfully to Heroku
1- Add a Procfile
Add a file to the project root folder Procfile with the following:
web: npm start
2- Add start script in package.json
.... "scripts": { ... "start": "bin/json-graphql-server.js db.js" }, ...
3- Update bin/json-graphql-server.js
Removed the Port and Host definitions Update the app.listen
#!/usr/bin/env node require('reify'); var path = require('path'); var express = require('express'); var JsonGraphqlServer = require('../lib/json-graphql-server.node.min').default; var dataFilePath = process.argv.length > 2 ? process.argv[2] : './data.json'; var data = require(path.join(process.cwd(), dataFilePath)); var app = express(); app.set('port', (process.env.PORT || 3000)); app.use('/', JsonGraphqlServer(data)); app.listen(app.get('port'));
Now, server runs in Heroku with no issues.
It will continue to work in your local env in your http://localhost:3000/
Sorry, something went wrong.
No branches or pull requests
Hi Guys,
I've tried to deploy the json-graphql-server to Heroku, but, I'm still not able to do do.
I'm getting
npm ERR! missing script: start
Can you please guide me on the correct way to configure the Heroku
Procfile
orpackage.json
to properly getting the server running on Heroku?Thanks a lot.
The text was updated successfully, but these errors were encountered: