diff --git a/server.js b/server.js index 21a4af6..435f1d9 100644 --- a/server.js +++ b/server.js @@ -50,6 +50,20 @@ export default function(opt) { }; }); + router.get('/api/tunnels/:id/delete', async (ctx, next) => { + const clientId = ctx.params.id; + const client = manager.getClient(clientId); + if (!client) { + ctx.throw(404); + return; + } + + manager.removeClient(clientId); + ctx.body = { + delete_status: "success", + }; + }); + app.use(router.routes()); app.use(router.allowedMethods());