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`,
  );
});
