I raised the server with express
, however using a schema for webpack
because I did not find anything related to browserify
, follow the code ...
// server.js
var express = require('express');
var path = require('path');
var serveStatic = require('serve-static');
app = express();
app.use(serveStatic(__dirname + "/dist"));
var port = process.env.PORT || 5000;
app.listen(port);
console.log('server started '+ port);
everything is set up correctly, but it is only appearing ...
Can not GET /
Does anyone know how I can do this?
package.json
"scripts": {
"watchify": "watchify -vd -p browserify-hmr -e src/main.js -o dist/build.js",
"serve": "http-server -o -s -c 1 -a localhost",
"dev": "npm-run-all --parallel watchify serve",
"build": "cross-env NODE_ENV=production browserify -g envify src/main.js | uglifyjs -c warnings=false -m > dist/build.js",
"postinstall": "npm install express",
"start" : "node server.js"
},
With the command that is in start
the server raises, however the application is not found.
Obs. to start it locally you need a npm run dev
that could not be executed in start
in heroku.