Web API for code.
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.
 
 

22 lines
478 B

  1. import { FastifyInstance } from 'fastify';
  2. import * as git from './modules/git'
  3. export const addRoutes = (server: FastifyInstance) => {
  4. server.get('/', async (_, reply) => {
  5. reply.send({hello: 'world'})
  6. });
  7. const gitController = new git.GitControllerImpl()
  8. server.route({
  9. method: 'POST',
  10. url: '/repos',
  11. handler: gitController.createRepo,
  12. })
  13. server.route({
  14. method: 'DELETE',
  15. url: '/repos/:id',
  16. handler: gitController.deleteRepo,
  17. })
  18. }