UNPKG

@tdb/web

Version:

Common condiguration for serving a web-site and testing web-based UI components.

20 lines (16 loc) 397 B
import { log, express } from '../server/common'; import { router } from './routes'; const app = express.app().use(router); app.get('/', async (req, res) => { const routes = express.routes(router); res.send({ routes }); }); /** * Start listening */ const PORT = 8080; app.listen(PORT, () => { log.info.gray( `\nListening on ${log.magenta('localhost')}:${log.cyan(PORT)}\n`, ); });