Last active
September 29, 2023 14:14
-
-
Save EvanHahn/5673968 to your computer and use it in GitHub Desktop.
Do you love anime?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- Put this in views/index.pug | |
doctype html | |
html | |
body | |
h1 Hello, world! | |
p= message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "i_love_anime", | |
"private": true, | |
"author": "Evan Hahn", | |
"license": "WTFPL", | |
"dependencies": { | |
"express": "^4.16.4", | |
"pug": "^2.0.3" | |
} | |
} |
Great tutorial, thanks!
Good tutorial, I'm feeling positive to go from Node.js into the world of Express, and that is always a good start.
One of the best tutorials on the Internet, thank you!
3 years later, still one of the best Node/Express tutorials.
Really loved it. Thanks!
It's 2017 and this tutorial is still awesome.
A very well-written and easy to understand tutorial.
Great job and thanks a lot :)
Thank you, Im still learning. But hallo Express, here I come.
棒棒哒
Great tutorial that made me chuckle and learn at the same time–in the words of Owen Wilson, "wow"!
Great Tuto. Thanks a lot
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great tutorial, except some parts are outdated.
in the index.jade, doctype 5 is deprecated, doctype html is working