Tools for learning Japanese.
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.

35 lines
801 B

  1. import { FastifyInstance } from 'fastify';
  2. import { InitController, InitControllerImpl } from './modules/init';
  3. export const addDefaultRoutes = (server: FastifyInstance) => {
  4. server
  5. .route({
  6. method: 'GET',
  7. url: '/api/health/live',
  8. handler: async (_, reply) => {
  9. reply.send({
  10. status: 'ok',
  11. });
  12. },
  13. })
  14. .route({
  15. method: 'GET',
  16. url: '/api/health/ready',
  17. handler: async (_, reply) => {
  18. reply.send({
  19. status: 'ready',
  20. });
  21. },
  22. });
  23. };
  24. export const addInitRoutes = (server: FastifyInstance) => {
  25. const initController: InitController = new InitControllerImpl();
  26. server
  27. .route({
  28. method: 'POST',
  29. url: '/api/download',
  30. handler: initController.downloadDataset,
  31. });
  32. };