diff --git a/package.json b/package.json index 60aef26..dcb3f70 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "author": "Enrico Fasoli (fazo96)", "license": "MIT", "dependencies": { - "diet": "^0.9.22", + "express": "^4.13.3", "ipfs-api": "^2.6.2" } } diff --git a/server.js b/server.js old mode 100644 new mode 100755 index b4b11c9..10be432 --- a/server.js +++ b/server.js @@ -1,5 +1,18 @@ #!/usr/bin/env node var ipfs = require('ipfs-api')('localhost','5001') +var express = require('express') +var app = express() +// Serve files in ./static +app.use(express.static('static')) +// CatchAll route: serve the angular app +app.get('*',function(req,res){ + res.sendFile(__dirname+'/static/index.html') +}) + +// Start http server +app.listen(3000,function(){ + console.log('Started') +}) diff --git a/static/index.html b/static/index.html index fb335cd..308b5ba 100644 --- a/static/index.html +++ b/static/index.html @@ -5,5 +5,6 @@ + Hello World