Skip to content

Commit c658a66

Browse files
committed
Merge branch 'development'
2 parents 18b7517 + 6904915 commit c658a66

File tree

5 files changed

+75
-0
lines changed

5 files changed

+75
-0
lines changed

express/appfavicon.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env node
2+
const express = require("express");
3+
const path = require("path");
4+
const favicon = require("express-favicon");
5+
6+
const app = express();
7+
8+
app.use(favicon(path.join(__dirname, "public", "images", "favicon.ico")));
9+
10+
app.get("/", (req, res) => {
11+
res.set({ "Content-Type": "text/plain; charset=utf-8" });
12+
res.send("Home page");
13+
});
14+
15+
app.listen(3000, () => {
16+
console.log("Application started on port 3000");
17+
});

express/approutes.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env node
2+
const express = require("express");
3+
const routes = require("./routes");
4+
5+
const app = express();
6+
7+
app.use(routes);
8+
9+
app.listen(3000, () => {
10+
console.log("Application started on port 3000");
11+
});

express/data/cities.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
BEGIN TRANSACTION;
2+
DROP TABLE IF EXISTS cities;
3+
4+
CREATE TABLE cities(id INTEGER PRIMARY KEY, name TEXT, population INTEGER);
5+
INSERT INTO cities(name, population) VALUES('Bratislava', 432000);
6+
INSERT INTO cities(name, population) VALUES('Budapest', 1759000);
7+
INSERT INTO cities(name, population) VALUES('Prague', 1280000);
8+
INSERT INTO cities(name, population) VALUES('Warsaw', 1748000);
9+
INSERT INTO cities(name, population) VALUES('Los Angeles', 3971000);
10+
INSERT INTO cities(name, population) VALUES('New York', 8550000);
11+
INSERT INTO cities(name, population) VALUES('Edinburgh', 464000);
12+
INSERT INTO cities(name, population) VALUES('Berlin', 3671000);
13+
COMMIT;

express/routes.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const express = require("express");
2+
const router = express.Router();
3+
4+
router.get("/", (req, res) => {
5+
res.set({ "Content-Type": "text/plain; charset=utf-8" });
6+
res.send("Home page");
7+
});
8+
9+
router.get("/about", (req, res) => {
10+
res.set({ "Content-Type": "text/plain; charset=utf-8" });
11+
res.send("About page");
12+
});
13+
14+
router.get("/contact", (req, res) => {
15+
res.set({ "Content-Type": "text/plain; charset=utf-8" });
16+
res.send("Contact page");
17+
});
18+
19+
module.exports = router;

express/views/showdate.liquid

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Show date</title>
7+
</head>
8+
<body>
9+
10+
<p>
11+
Today is {{ now }}
12+
</p>
13+
14+
</body>
15+
</html>

0 commit comments

Comments
 (0)