diff --git a/.gitignore b/.gitignore index c2658d7..dbd17a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules/ +test/ diff --git a/server.js b/server.js index 10be432..bb21e7f 100755 --- a/server.js +++ b/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') diff --git a/static/app.js b/static/app.js index e69de29..fb7d2cc 100644 --- a/static/app.js +++ b/static/app.js @@ -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" ] + } + }) +}) diff --git a/static/board.html b/static/board.html new file mode 100644 index 0000000..211b02e --- /dev/null +++ b/static/board.html @@ -0,0 +1,3 @@ +
+
{{post}}
+
diff --git a/static/home.html b/static/home.html new file mode 100644 index 0000000..480ec0b --- /dev/null +++ b/static/home.html @@ -0,0 +1 @@ +Landing Page diff --git a/static/index.html b/static/index.html index 308b5ba..7343718 100644 --- a/static/index.html +++ b/static/index.html @@ -1,10 +1,17 @@ IPFS Board - - - + + + + + + - Hello World + + + + +