Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/themost-framework/ejs
- Owner: themost-framework
- License: bsd-3-clause
- Created: 2022-03-25T05:13:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-03-27T06:38:23.000Z (over 2 years ago)
- Last Synced: 2024-08-09T20:43:41.347Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 138 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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%>