Skip to content

Instantly share code, notes, and snippets.

@EvanHahn
Last active September 29, 2023 14:14
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save EvanHahn/5673968 to your computer and use it in GitHub Desktop.
Save EvanHahn/5673968 to your computer and use it in GitHub Desktop.
Do you love anime?
// Start Express
const express = require("express");
const app = express();
// Set the view directory to /views
app.set("views", __dirname + "/views");
// Let's use the Pug templating language
app.set("view engine", "pug");
// Do you love anime?
app.get("/", (request, response) => {
response.render("index", { message: "I love anime" });
});
// Start that server
app.listen(1337);
//- Put this in views/index.pug
doctype html
html
body
h1 Hello, world!
p= message
{
"name": "i_love_anime",
"private": true,
"author": "Evan Hahn",
"license": "WTFPL",
"dependencies": {
"express": "^4.16.4",
"pug": "^2.0.3"
}
}
@RaedAddala
Copy link

Great Tuto. Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment