I am trying to deploy a Vue application on Heroku. I choose Express as my server and made a pretty basic server which listens on port 5000. i am trying to sendfile index.html as the users enter the website. PS: Using this for reference:- https://codeforgeek.com/2015/01/render-html-file-expressjs/#
server.js
var express = require('express');
var path = require("path");
var app = express();
app.get('/',function(req,res){
res.sendFile(path.join(__dirname+'/index.html'));
});
var port = process.env.PORT || 3000;
app.listen(port);
console.log("Server started");
Heroku runs its build and says build successful. Even Travis passes the build but the index.html isn't rendred on the website for some reason. I check the console and i see the html code loaded though. Website: https://countr-app.herokuapp.com/
I'm not sure whats wrong.
via user3627194
No comments:
Post a Comment