Я пытаюсь создать простое приложение node.js на heroku.Вот мой app.js:
console.log("Starting App")
const express = require('express')
const app = express()
const port = 3000
app.listen(process.env.PORT || port, () => console.log(`App listening on port ${port}!`))
app.get('/', (req,res) => {
res.sendFile(__dirname+'/public/index.html')
})
app.get('/style', (req,res) => {
res.sendFile(__dirname+'/public/main.css')
})
app.get('/script', (req,res) => {
res.sendFile(__dirname+'/public/script.js')
})
app.get('/changelog', (req,res) => {
res.sendFile(__dirname+'/public/changelog.txt')
})
вот мой файл package.json:
{
"name": "",
"version": "0.0.0",
"description": "",
"main": "/App.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.16.4"
}
}
и вот мой Procfile:
web: node app.js
Я развертываю это на heroku через github, и всякий раз, когда я запускаю программу, она выдает мне ошибку, сказав, что не может найти модуль '/app/app.js.'Я сделал все строчными и убрал косые черты.Я все еще получаю эту ошибку: Ошибка: Не удается найти модуль '/app/app.js' Может кто-нибудь помочь?