(options: ServerOptions)
| 59 | }) |
| 60 | |
| 61 | export const startServer = (options: ServerOptions) => { |
| 62 | SERVER_OPTIONS_WEAKMAP.set(server, options) |
| 63 | const { host, port, persistenceOptions = { provider: 'leveldb' }, contentField } = options |
| 64 | |
| 65 | if (persistenceOptions !== false) { |
| 66 | initPersistence(persistenceOptions, contentField) |
| 67 | } |
| 68 | |
| 69 | server.listen(port, host, () => { |
| 70 | console.log(`running at '${host}' on port ${port}`) |
| 71 | }) |
| 72 | return server |
| 73 | } |
no test coverage detected