Express & Ejs Template
Express.js Template
What this package includes
- Ejs in HTML files
- RenderFile Function
- Default ejs templates
The RenderFile Function
- Renders html files as ejs
- Allows for miltiple ejs templates, quickly, and easy
app.get('/', (req, res) => {
RenderFile(res, 'filename', {
key: "value" // pass extra data specifically to "/"
}
}
<h1><%= key %></h1>
<!-- Displays "value" on the website -->
ejsData file
- Used for passing ejsData to all files in router
ejsData.helloWorld = 'hi';
<h1><%= helloWorld %></h1> <!-- Displays "hi" to the website %>
JuanR4140 (33)
so cool lol
RohilPatel (1535)
Lol ty. If you need help lemme know @JuanR4140
the great thing about this is that now i can finally use emmett while writing html (ejs) files!
I love how your 4 cycles behind me
Haha lol, also ty! Have fun using Emmett! @EpicGamer007
@RohilPatel thx
Now it's time for me to make something to get more cycles than you lol @EpicGamer007