Eta with Express.js | Eta

var

express

=

require

(

"express"

)

var

app

=

express

(

)

var

eta

=

require

(

"eta"

)

app

.

engine

(

"eta"

,

eta

.

renderFile

)

eta

.

configure

(

{

views

:

"./views"

,

cache

:

true

}

)

app

.

set

(

"views"

,

"./views"

)

app

.

set

(

"view cache"

,

true

)

app

.

set

(

"view engine"

,

"eta"

)

app

.

get

(

"/"

,

function

(

req

,

res

)

{

res

.

render

(

"template"

,

{

favorite

:

"Eta"

,

name

:

"Ben"

,

reasons

:

[

"fast"

,

"lightweight"

,

"simple"

]

}

)

}

)

app

.

listen

(

8000

,

function

(

)

{

console

.

log

(

"listening to requests on port 8000"

)

}

)