mirror of
https://github.com/fazo96/ipfs-boards
synced 2025-03-12 21:48:39 +01:00
25 lines
517 B
JavaScript
Executable File
25 lines
517 B
JavaScript
Executable File
#!/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'))
|
|
|
|
app.get('/@:user/:board',function(req,res){
|
|
ipfs.cat(req.params.user+'/'+req.params.board,function(err,res){
|
|
|
|
})
|
|
})
|
|
|
|
// 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')
|
|
})
|