Closed TrangNguyen closed 9 years ago
The included connect task in the gruntfile just starts a small webserver to serve the (local) project files to the browser. This has nothing to do with any backend.
If you don't want to use it and use your own local webserver to serve project files you have to configure this for yourself. With expressjs you should define somewhere a static file server, for example like this:
server.use(express.static(__dirname + '/app'));
But I have not that much experience with expressjs.
Thank you. I have tried having express running on a port and the app as is with connect to start web-server on a different port. Locally I have an issue with CORS when using $resource in angular, even after setting CORS in express. I need express to do more than serving static file, it should be a RESTful API with mongoose. If angular scripts were included in the index.html script tags (without requirejs), it would work. But in combination with requirejs, which I have little experience working with, so it's bit tricky. Anyway, thank for your time.
Hi,
I'm trying to add express (and mongoose) as server side for the app but I can't get the app running. I remove connect from grunt web tasks and start my express server separately, which only sends index.html. However it doesn't seem to work, no script is loaded front end. Am I missing something? Thanks very much. Trang