Express_Angular2_Twitter_App icon indicating copy to clipboard operation
Express_Angular2_Twitter_App copied to clipboard

the page not loading

Open arun4san opened this issue 9 years ago • 3 comments

Hi ,

once all setup is done that app is not working and i'm getting error like "No default engine was specified and no extension was provided."

and when i refresh the page also i'm getting error called not found..

looking forward the solutions of the issues..

Thanks, Arun S

arun4san avatar Oct 20 '16 09:10 arun4san

Hi, @arun4san. Can you be more specific? What do you mean by "once all setup is done"? At which point in trying to run the app? And where are you getting the error message?

I'm happy to try to help, but this isn't a project that I'm actively working on at the moment. It should be noted, too, that a lot has changed about Angular 2 since I created this toy app several months ago.

bolducp avatar Oct 20 '16 15:10 bolducp

Hi @bolducp thanks for the replay..once i have npm install started the server. and i'm getting error like No default engine was specified and no extension was provided. and please can u update the latest angular 2 project.so that will help me to use latest one..

arun4san avatar Oct 24 '16 05:10 arun4san

hey @arun4san I've posted a comment here: https://github.com/bolducp/Express_Angular2_Twitter_App/issues/3 regarding the no View engine issue.

I've managed to set up the latest angular2 seed with @bolducp's code, and seems to work well. The change required was in app.js:

app.use('/node_modules', express.static(path.join(__dirname, '../node_modules')));

The above line was added right after this one:

app.use(express.static(path.join(__dirname, '../src'))); (for me, I didn't rename my angular src folder to client)

That allows your static JS files called in index.html to get loaded by express js properly. Here is the guide I used: https://expressjs.com/en/starter/static-files.html

In the angular2's index.html I left my as <base href="/">. And everything should load fine from http://localhost:3000/

magz99 avatar May 29 '17 12:05 magz99