-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathpages.js
More file actions
38 lines (34 loc) · 765 Bytes
/
pages.js
File metadata and controls
38 lines (34 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import express from "express";
const app = express();
app.get("/", (_request, response) => {
response.send(`
<body>
<h1>Main page</h1>
<h2>Shows main content</h2>
</body>
`);
});
app.get("/about", (_request, response) => {
response.send(`
<body>
<h1>About</h1>
<p>This is an about page</p>
</body>
`);
});
app.get("/contact", (_request, response) => {
response.send(`
<body>
<h1>Contact</h1>
<p>This is a contact page</p>
<form>
<label>name</label>
<input placeholder="Write your name">
<button>Contact me</button>
</form>
</body>
`);
});
app.listen(3000, function () {
console.log(`> Ready on http://localhost:3000`);
});