user2981029
user2981029

Reputation: 584

How replace jade by html

I'm using the express skelton to develope an app. I don't know how to use jade language, so I want to convert this files to html, I did that, but my problem now it's I have 2 lines the aim js : app.js that have to change

// view engine setup            
app.set('views', path.join(__dirname, 'views'));         
app.set('view engine', 'jade');      

Please can you help me to change this lines, thank you.

Upvotes: 1

Views: 1228

Answers (1)

Sumit Bisht
Sumit Bisht

Reputation: 1517

You can use EJS(http://embeddedjs.com/) as a view engine and use the html (in form of ejs files)

`app.set('view engine', 'ejs');`

and place the .ejs files containing the html code within the view folder.

You'll have to update the dependencies in the package.json as well

"ejs": ">= 0.0.0"

For listing static html pages, use this property in express

`app.use(express.static(path.join(__dirname, 'public')));`

and place your .html files within the public folder.

Upvotes: 1

Related Questions