我正在尝试在解析服务器上实施电子邮件验证。但是我正在努力使其运行。我已经直接通过Heroku安装了Parse,现在我需要配置package.json和index.js
错误日志告诉我启动脚本有问题吗?:
> 2019-03-14T14:32:50.298220+00:00 app[web.1]: npm ERR! code ELIFECYCLE
> 2019-03-14T14:32:50.298558+00:00 app[web.1]: npm ERR! errno 1
> 2019-03-14T14:32:50.299585+00:00 app[web.1]: npm ERR!
> testapp@1.0.0 start: `node index.js`
> 2019-03-14T14:32:50.299711+00:00 app[web.1]: npm ERR! Exit status 1
> 2019-03-14T14:32:50.299901+00:00 app[web.1]: npm ERR!
> 2019-03-14T14:32:50.300009+00:00 app[web.1]: npm ERR! Failed at the
> testapp@1.0.0 start script.
> 2019-03-14T14:32:50.300129+00:00 app[web.1]: npm ERR! This is probably
> not a problem with npm. There is likely additional logging output
> above. 2019-03-14T14:32:50.306698+00:00 app[web.1]: npm WARN Local
> package.json exists, but node_modules missing, did you mean to
> install? 2019-03-14T14:32:50.307348+00:00 app[web.1]:
> 2019-03-14T14:32:50.307593+00:00 app[web.1]: npm ERR! A complete log
> of this run can be found in: 2019-03-14T14:32:50.307710+00:00
> app[web.1]: npm ERR!
> /app/.npm/_logs/2019-03-14T14_32_50_301Z-debug.log
package.json:
{
"name": "testapp",
"version": "1.0.0",
"description": "test",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"keywords": [
"example",
"heroku"
],
"author": "Name Nameson",
"license": "ISC",
"engines": {
"node": "10.15.0"
}
}
index.js:
var server = ParseServer({
...otherOptions,
// Enable email verification
verifyUserEmails: true,
// The public URL of your app.
// This will appear in the link that is used to verify email addresses and reset passwords.
// Set the mount path as it is in serverURL
publicServerURL: 'http://testapp.herokuapp.com/parse',
// Your apps name. This will appear in the subject and body of the emails that are sent.
appName: 'testapp',
// The email adapter
emailAdapter: {
module: 'parse-server-simple-mailgun-adapter',
options: {
// The address that your emails come from
fromAddress: 'parse@example.com',
// Your domain from mailgun.com
domain: 'randomsandbox.mailgun.org',
// Your API key from mailgun.com
apiKey: 'Mailgun key',
}
}
});