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:
parent
927f775a3d
commit
4501fdfdaf
@ -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
13
server.js
Normal file → Executable 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')
|
||||
})
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user