juliano.net
juliano.net

Reputation: 8177

Express generator with Swig

I'm trying to use Express generator to create the application skeleton, however it seems to work only with Jade and EJS.

I don't like the idea from Jade of not using tags, because the code becomes a complete mess. And I already started working with Swig, but there aren't any options for it on Express generator.

How can I create this common structure using Express and Swig faster?

Upvotes: 2

Views: 2775

Answers (2)

Ritesh Dhuri
Ritesh Dhuri

Reputation: 215

because of less reputation i unable to comment your answer. @Sreekesh Okky

in your answer why you write people; after requiring swig explain me in details why to use people;

Upvotes: 0

Okky
Okky

Reputation: 10466

Refer Swig with Express.js

In that there is option to change the default engine from Jade to HTML

var app = require('express')(),
  swig = require('swig'),
  people;

// This is where all the magic happens!
app.engine('html', swig.renderFile);

app.set('view engine', 'html');

Upvotes: 5

Related Questions