I have the following code on Angular side: app.js
angular.module('myApp',[
'ngRoute'
])
.config(function ($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
redirectTo: '/signin'
})
.when('/signup', {
templateUrl: 'app/account/signup/signup.html',
controller: 'signupController',
controllerAs: 'ctrl'
})
.when('/signin', {
templateUrl: 'app/account/signin/signin.html',
controller: 'signinController',
controllerAs: 'ctrl'
})
})
And following code on my express side: server.js
var express = require('express');
var app = express();
var path = require("path");
var router = express.Router();
router.get('/', function(req, res){
res.status(200).sendFile(path.join(__dirname + '/index.html'));
});
app.listen(8000);
signup.html and signin.html are ng-views inside index.html.
Currently I'm only being able to serve one static page. Is there any way that we're able to use the angular route configuration? Or I must write separate routings in express one more time?