question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using ejs with polka?

See original GitHub issue

Hi, I’m a little bit confused on how would you use the ejs (Embedded JavaScript) template engine in polka, this is how i do it in express

app.set("views", path.join(__dirname, "views")); // tell express where all our pages are
app.set("view engine", "ejs");

app.get("/", (req, res) => {
  res.render("index.ejs", { someVariable: "someValue" });
});

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
talentlessguycommented, Sep 14, 2020

Ik this thread is quite old but there’s a Polka plugin for EJS: https://github.com/ravener/polka-ejs/blob/master/index.js

just in case anyone needs it

1reaction
RojinaBajracommented, Apr 17, 2019

dont work. What could be other reasons?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Polka-ejs NPM | npm.io
Polka EJS. Adds ejs template engine support to polka. Install. npm install polka-ejs. Usage. const polka = require("polka"); const ejs ...
Read more >
polka-ejs - npm Package Health Analysis | Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix advice.
Read more >
Introduction to Polka (an alternative to Express.js)
Polka doesn't offer any built-in view/rendering engines. (Using ejs with polka?) Most templating engines can be incorporated into middleware functions or used ...
Read more >
Polka: an express.js alternative - David.Dev
const ejs = require("polka-ejs"); app.use(ejs()); // load ejs for templating v var hello = "hello world"; app.get ...
Read more >
Now You Node— #1 — Intro & polka - Medium
If you are familiar with Express.js you already know how to use polka but if you are building your first http server with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found