Skip to content

Instantly share code, notes, and snippets.

@fguisso
Last active August 29, 2015 14:02
Show Gist options
  • Save fguisso/8393f50bdeb235cf1772 to your computer and use it in GitHub Desktop.
Save fguisso/8393f50bdeb235cf1772 to your computer and use it in GitHub Desktop.
app.js
var onepageApp = angular.module('onepageApp', ['ngRoute']);
onepageApp.config(function($routeProvider) {
$routeProvider
.when('/', {
templateUrl : 'pages/home.html',
controller : 'mainController'
})
.when('/about', {
templateUrl : 'pages/about.html',
controller : 'aboutController'
})
.when('/contact', {
templateUrl : 'pages/contact.html',
controller : 'contactController'
});
});
onepageApp.controller('mainController', function($scope) {
$scope.message = 'Welcome to the wonderful world of AngularJS!';
});
onepageApp.controller('aboutController', function($scope) {
$scope.message = 'This an exemple of AngularJS one page';
});
onepageApp.controller('contactController', function($scope) {
$scope.message = 'Keep in touch!';
});
var http = require('http')
, fs = require('fs')
;
http.createServer(function(req, res) {
var index = fs.readFileSync('index.html')
;
res.writeHead(200, {'Content-Type': 'text/html;chaset=utf-8'});
res.end(index);
}).listen(3000);
console.log('Seu server esta rodando em http://localhost:3000/');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment