Skip to content

Commit af47b8b

Browse files
committed
add page for http-protocol
1 parent 9f15586 commit af47b8b

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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>Example</title>
7+
</head>
8+
<body>
9+
<h1>It works!</h1>
10+
</body>
11+
</html>

server/src/handlers/openapi.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ const getHandlers = (state) => {
315315
unauthorizedHandler: (c, req, res) => res
316316
.status(401)
317317
.send({ code: 401, message: 'Please authenticate first. Header example: "Authorization: Bearer token"' }),
318-
notImplementedHandler: (c, req, res) => res
319-
.status(404)
320-
.send({ code: 501, message: 'No handler registered for operation' }),
318+
// notImplementedHandler: (c, req, res) => res
319+
// .status(404)
320+
// .send({ code: 501, message: 'No handler registered for operation' }),
321321
};
322322
};
323323

server/src/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ const initOpenapi = async (names, app) => {
9898
export default async (app, _options) => {
9999
await app.register(formbody);
100100
setUpStaticAssets(app);
101-
await initOpenapi(apps, app);
102101

103102
app.get('/http-protocol/example', (req, res) => {
104103
res
@@ -145,13 +144,15 @@ export default async (app, _options) => {
145144
});
146145
});
147146

148-
app.get('/http-protocol/removed', (req, res) => {
149-
res.code(301).redirect('/http-protocol/example');
150-
});
147+
app.get('/http-protocol', (req, res) => res.sendFile('http-protocol/index.html'));
148+
149+
app.get('/http-protocol/removed', (req, res) => res.code(301).redirect('/http-protocol/example'));
151150

152151
app.get('/js-playwright/users-list', (req, res) => res.sendFile('users-list/index.html'));
153152

154153
app.get('/js-dom-testing-library/users-list', (req, res) => res.sendFile('users-list/index.html'));
155154

155+
await initOpenapi(apps, app);
156+
156157
return app;
157158
};

0 commit comments

Comments
 (0)