mirror of
https://github.com/fazo96/ipfs-boards
synced 2025-01-25 14:54:19 +01:00
wip
This commit is contained in:
parent
11728930d9
commit
110000beef
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
node_modules/
|
||||
test/
|
||||
|
12
server.js
12
server.js
@ -7,11 +7,17 @@ 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')
|
||||
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')
|
||||
|
@ -0,0 +1,24 @@
|
||||
console.log(require('ipfs-api'))
|
||||
|
||||
var boards = angular.module('boards',['ui.router'])
|
||||
|
||||
boards.config(function($stateProvider,$urlRouterProvider,$locationProvider){
|
||||
$urlRouterProvider.otherwise('/')
|
||||
//$locationProvider.html5Mode({ enabled: true, requireBase: false })
|
||||
|
||||
$stateProvider.state('home',{
|
||||
url: '/',
|
||||
templateUrl: 'home.html',
|
||||
controller: function($scope){
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
$stateProvider.state('board',{
|
||||
url: '/board/:name',
|
||||
templateUrl: 'board.html',
|
||||
controller: function($scope,$stateParams){
|
||||
$scope.posts = [ "hey", "test", "something" ]
|
||||
}
|
||||
})
|
||||
})
|
3
static/board.html
Normal file
3
static/board.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div ng-repeat="post in posts">
|
||||
<div>{{post}}</div>
|
||||
</div>
|
1
static/home.html
Normal file
1
static/home.html
Normal file
@ -0,0 +1 @@
|
||||
Landing Page
|
@ -1,10 +1,17 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>IPFS Board</title>
|
||||
<link rel="stylesheet" href="butstràp">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Bootstrap -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" integrity="sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX" crossorigin="anonymous">
|
||||
<!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>-->
|
||||
<!-- Angular -->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
|
||||
Hello World
|
||||
<script src="http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js"></script>
|
||||
<script src="/app.js"></script>
|
||||
</head>
|
||||
<body ng-app="boards">
|
||||
<div ui-view></div>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user