1
0
mirror of https://github.com/fazo96/ipfs-boards synced 2025-01-10 12:24:20 +01:00

implement http server

This commit is contained in:
Enrico Fasoli 2015-11-04 16:41:17 +01:00
parent 927f775a3d
commit 4501fdfdaf
3 changed files with 15 additions and 1 deletions

View File

@ -9,7 +9,7 @@
"author": "Enrico Fasoli (fazo96)",
"license": "MIT",
"dependencies": {
"diet": "^0.9.22",
"express": "^4.13.3",
"ipfs-api": "^2.6.2"
}
}

13
server.js Normal file → Executable file
View File

@ -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')
})

View File

@ -5,5 +5,6 @@
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
Hello World
</body>
</html>