Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/themost-framework/ejs

EJS view engine extension for supporting layouts
https://github.com/themost-framework/ejs

Last synced: about 7 hours ago
JSON representation

EJS view engine extension for supporting layouts

Awesome Lists containing this project

README

        

# @themost/ejs

EJS view engine extension for supporting layouts

## Installation

npm i @themost/ejs

## Usage

Register [EJS](https://github.com/mde/ejs) view engine extension for Express.js

import express from 'express';
import path from 'path';
import {ViewEngine} from '@themost/ejs';

const app = express();
// set ejs engine
app.engine('ejs', ViewEngine.express());
app.set('view engine', 'ejs');
// resolve views root path
app.set('views', path.resolve(__dirname, './views'));

And start using ejs layouts:

layout.ejs






<%- body %>

page.ejs

<% layout('master') %>


My First Message


<%=message%>