Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: No default engine was specified and no extension was provided. #7

Open
useralive003 opened this issue Jan 11, 2018 · 6 comments

Comments

@useralive003
Copy link

I created new login component i add routes for login but when try to run this page i am getting No default engine was specified and no extension was provided.can you please help me out if i want to add new pages what can i do help me

@emilb604
Copy link

same thing happened for me

@merby04
Copy link

merby04 commented Feb 15, 2018

Me.. Too..
Plz Help

@JasonMonroe-EdgeTech
Copy link

I had this issue and fixed with these two lines in app.js:

app.engine('html', require('ejs').renderFile);
app.set('view engine', 'html');

There may be a better solution, as I am new to the MEAN stack myself. The only issue I am having now with this tutorial is any manual refresh of the browser or manual typing of urls bypasses the angular routes and tries to use the node routes. I've read a few posts about fixing this, but would love to see what didinj's solution would be.

@pranavwhiz
Copy link

I also had this issue and found a fix for that, just add below code in app.js

app.use('/book-create', express.static(path.join(__dirname, 'dist')));
app.use('/book-details/:id', express.static(path.join(__dirname, 'dist')));
app.use('/book-edit/:id', express.static(path.join(__dirname, 'dist')));

after this code

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

Above we are just defining the routes for each link.
P.S. If anyone has any other solution, I would love to know that.

@hiyamgh
Copy link

hiyamgh commented Jul 17, 2018

Please I am having same error, I dont know whyyy

@vickrant
Copy link

vickrant commented Sep 2, 2018

add last line too as mentioned below with commenets
app.use('/books', express.static(path.join(__dirname, 'dist')));
app.use('/book', book);
app.use('', book); //add this line too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants