Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js without a template engine

I'm new into Node.js and trying to learn. From what I have understood it's common to use a template engine (eg. Jade), even for CSS (eg. Stylus). To be honest, all the tutorials I have seen out there involve a template engine when it comes to the layout.

The thing is that I don't want to use a template engine because I think it's unnecessarily complex.

Here is a link to a boilerplate for Node (unfortunately it doesn't work by some reason), but Option 1 shouldn't be using any template engine for the layout.

So, what is the easiest way to combine Node.js and Mongodb with "normal" HTML(5)? Is it possible for example to use HMTL5 Boilerplate with Node?

like image 331
holyredbeard Avatar asked Dec 02 '22 23:12

holyredbeard


1 Answers

If you are using static html, so you wont need templating on the server side. You can easily serve your html files with Express/Connect static middleware, for example:

app.use(express.static(__dirname + '/public'));

then put an index.html to your public folder.

Also I think you can copy and paste the whole h5bp to your public folder and it should work.

like image 130
Kalman Speier Avatar answered Dec 21 '22 00:12

Kalman Speier