Last active
August 29, 2015 14:02
-
-
Save fguisso/8393f50bdeb235cf1772 to your computer and use it in GitHub Desktop.
app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!'; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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