Note that there are some explanatory texts on larger screens.

plurals
  1. PONode.js Express serving index.html instead of static file
    primarykey
    data
    text
    <p>Im starting a node.js with express app, using angular. Everything was working fine while creating the app on cloud9.</p> <p>I just released the app on my ec2 instance and now node always deliver index.html instead of my static file... When i look in chrome debug network, i see all js files loaded (status 200) but when i preview them, its my index.html file... The type of my js files is also set to text/html...</p> <p>Here is my little server.js (no routing as i fake my angular data, so no call to the server for now...)</p> <pre><code>var express = require('express'), path = require('path'), http = require('http'), fs = require('fs'); var app = express(); var logFile = fs.createWriteStream('./logger/express.log', {flags: 'a'}); //use {flags: 'w'} to open in write mode app.configure(function () { app.set('port', process.env.PORT || 3000); app.use(express.logger({stream: logFile})); app.use(express.bodyParser()), app.use(express.static(path.join(__dirname, 'public'))); }); /*app.get('/events', eventRoute.getEvents); app.post('/events', eventRoute.saveEvent);*/ http.createServer(app).listen(app.get('port'), function () { console.log("Express server listening on port " + app.get('port')); }); </code></pre> <p>As i said previously, everything is working fine on cloud9 (cannot try on local for now...).</p> <p>Does anyone has a clue about what is going wrong?</p> <p>Thanks</p> <p>Dominic</p> <p>PS: I forgot to mention that it is the same with my CSS file!</p> <p>Edit: Here a little picture of what i mean! <img src="https://i.stack.imgur.com/5ScTX.png" alt="enter image description here"></p> <p>And when i look at the preview of any file i get <img src="https://i.stack.imgur.com/39dEn.png" alt="enter image description here"></p> <p>Edit2: I just deleted all my files and uploaded them again. Same problem! I really need help on this one please!</p> <p>Fo live demo of the problem, hit <a href="http://adocrate.com" rel="nofollow noreferrer">that site</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload