(configuration: DocumentationServerConfiguration)
| 46 | } |
| 47 | |
| 48 | export function startDocumentationServer(configuration: DocumentationServerConfiguration): any { |
| 49 | const app = polka(); |
| 50 | const root = path.resolve(configuration.root); |
| 51 | const serveStatic = sirv(root, { dev: true }); |
| 52 | const onListening = () => { |
| 53 | if (configuration.open) { |
| 54 | openInBrowser(getServerUrl(configuration)); |
| 55 | } |
| 56 | }; |
| 57 | |
| 58 | app.use(serveStatic); |
| 59 | |
| 60 | if (configuration.host) { |
| 61 | return app.listen(configuration.port, configuration.host, onListening); |
| 62 | } |
| 63 | |
| 64 | return app.listen(configuration.port, onListening); |
| 65 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…