I have a vuejs app which set up with vue cli, and i'm trying deploy my app to heroku.
Here's my server :
const express = require('express');
const port = process.env.PORT || 8080;
const app = express();
app.use(express.static(__dirname + "/dist/"));
app.get(/.*/ , function(req,res) {
res.sendfile(__dirname + "/dist/index.html");
});
app.listen(port);
console.log("Server started...");
- I remove dist from gitignore,
- I aded a start point like "start": "node server.js" in package.json
Here's what i see on console :
Failed to load resource: the server responded with a status of 503 (Service Unavailable) /favicon.ico:1
Here's heroku logs :
2019-12-13T08:55:49.464914+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=followgoals.herokuapp.com request_id=09df33ae-96ab-415a-929b-530fb943318d fwd="37.130.123.179" dyno= connect= service= status=503 bytes= protocol=https 2019-12-13T08:55:49.828341+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=followgoals.herokuapp.com request_id=21de7307-502e-4104-a648-8e6b0832a3fe fwd="37.130.123.179" dyno= connect= service= status=503 bytes= protocol=https
So what can i do the fix problem ?
server.jsis pretty short, the only possible issues I can think of are (1) node dependencies (express) not installed, or (2) the/dist/directory or/dist/index.htmldo not exist.