Я пытаюсь запустить приложение vuetify APP в локальной среде и среде Heroku.Мое приложение работает локально со следующими сценариями server.js:
const express = require('express');
// Import the package
const secure = require('express-force-https');
const path = require('path');
const serveStatic = require('serve-static');
//create the express app
app = express();
//create the middleware to handle the serving of the app
app.use(serveStatic(path.join(__dirname, 'dist')));
// Add it as a layer to the middleware
app.use(secure)
// Catch all routes and redirect to the index file
app.get('*', function (req, res) {
res.sendFile(__dirname + '/dist/index.html')
})
// Create default port to serve the app on
const port = process.env.PORT || 5000
app.listen(port)
// Log to feedback that this is actually running
console.log('Server started on port ' + port)
Я удалил папку /dist
из .gitignore и добавил web: node server.js
в мой Procfile.Все это прекрасно работает на локальном порту (5000), однако, как только я пытаюсь запустить файл в режиме реального времени на Heroku, я получаю следующую ошибку:
Произошла ошибка в приложении и на вашей страницене может быть обслужен.
Записывая журнал, я нашел это: Error: Cannot find module 'express'
Я считаю, что существует проблема со средой, в которой я должен работатьприложение в прямом эфире.Может ли кто-нибудь помочь мне в этом?