diff --git a/package.json b/package.json index 3c49bc7..d4ff3c6 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "documentation": "solidity-docgen --solc-module ./node_modules/solc", "test": "truffle test --network development", "coverage": "truffle run coverage --file='test/*.test.js' --network coverage", - "start": "webpack-dev-server" + "start": "node server.js", + "heroku-postbuild": "truffle compile && webpack -p" }, "repository": { "type": "git", diff --git a/server.js b/server.js new file mode 100644 index 0000000..1585f12 --- /dev/null +++ b/server.js @@ -0,0 +1,20 @@ +const express = require('express'); +const path = require('path'); +const port = process.env.PORT || 8080; +const app = express(); + +// the __dirname is the current directory from where the script is running +app.use(express.static(__dirname + '/public')); + +// send the user to index html page inspite of the url +app.get('/', (req, res) => { + res.sendFile(path.resolve(__dirname, 'index.html')); +}); +app.get('/deploy.html', (req, res) => { + res.sendFile(path.resolve(__dirname, 'deploy.html')); +}); +app.get('/interact.html', (req, res) => { + res.sendFile(path.resolve(__dirname, 'interact.html')); +}); + +app.listen(port); \ No newline at end of file