Extra contents beyond WaniKani
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
599 B

import fastify from 'fastify';
import kanjiRouter from './router/kanji';
import vocabularyRouter from './router/vocabulary';
import { isDev } from './shared';
async function main() {
const port = parseInt(process.env['PORT']!) || 13358;
process.env['PORT'] = port.toString();
const app = fastify({
logger: {
prettyPrint: isDev,
},
});
app.register(import('@fastify/cors'));
app.register(kanjiRouter, {
prefix: '/api/kanji',
});
app.register(vocabularyRouter, {
prefix: '/api/vocabulary',
});
await app.listen(port, isDev ? '' : '0.0.0.0');
}
main();