Skip to content

Commit 5abe28c

Browse files
committed
test static page routing
1 parent 4008745 commit 5abe28c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/server.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ app.use('/dist/service-worker.js', (req, res, next) => {
5151
return next();
5252
});
5353

54+
app.get('/hello', (req, res) => {
55+
res.sendFile(path.join(__dirname, '..', 'static', 'hello.html'));
56+
});
57+
5458
app.use('/dist/dlls/:dllName.js', (req, res, next) => {
5559
fs.access(
5660
path.join(__dirname, '..', 'static', 'dist', 'dlls', `${req.params.dllName}.js`),

static/hello.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Static page</title>
6+
</head>
7+
<body>
8+
<p>
9+
You can have a static page with standalone theme.
10+
</p>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)