I download the code and run got this message in the browser.
Cannot GET /
I did some modification and then it works. Here I am requesting pull or people can do these modifications.
for server.js
from
app.get('/NodeMovieList', function (request, response) {
response.sendfile("views/MoviesList.html");
});
app.get('/NodeMovieList/api/movies', mongoOps.fetch);
app.post('/NodeMovieList/api/movies', mongoOps.add);
app.put('/NodeMovieList/api/movies/:movieId', mongoOps.modify);
app.use('/NodeMovieList', express.static(path.join(__dirname, 'public')));
to
app.get('/', function (request, response) {
response.sendfile("views/MoviesList.html");
});
app.get('/api/movies', mongoOps.fetch);
app.post('/api/movies', mongoOps.add);
app.put('/api/movies/:movieId', mongoOps.modify);
app.use('/', express.static(path.join(__dirname, 'public')));
MoviesList.html
from
...
<script src="NodeMovieList/scripts/movie.js"></script>
to
...
<script src="/scripts/movie.js"></script>
movie.js
from
app.factory('moviesCRUD', function ($http, $q) {
var baseurl = "/NodeMovieList/";
function getAllMovies() {
var deferred = $q.defer();
to
app.factory('moviesCRUD', function ($http, $q) {
var baseurl = "/";
function getAllMovies() {
var deferred = $q.defer();
Then the project will work. Both versions are different from the code list in
http://www.dotnetcurry.com/magazine/dnc-magazine-issue13.aspx
regards,
Lin Xie