forked from hapi-swagger/hapi-swagger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.test-d.ts
44 lines (40 loc) · 842 Bytes
/
index.test-d.ts
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
39
40
41
42
43
44
import { Server } from '@hapi/hapi';
import * as hapiswagger from '.';
(async () => {
const server = new Server({ debug: false, port: 0 });
server.register({
plugin: hapiswagger,
options: {
cors: true,
jsonPath: '/jsonpath',
info: {
title: 'a',
description: 'b',
termsOfService: 'c',
contact: {
name: 'a',
url: 'localhost',
email: '[email protected]'
}
},
tagsGroupFilter: (tag: string) => tag !== 'api'
}
});
server.route({
method: 'GET',
path: '/',
handler: () => 'hi',
options: {
auth: false,
plugins: {
'hapi-swagger': {
order: 2,
deprecated: false,
'x-api-stuff': 'a'
}
}
}
});
await server.start();
await server.stop();
})();