router.all('/check/healthcheck.html', function(ctx) { const isAt = fs.existsSync(HealthcheckPath); if (!isAt) { ctx.status = 404; } ctx.body = { status: 0 }; });
router .get('/', function(ctx, next) { ctx.body = 'Hello World!'; }) .post('/user', function(ctx, next) { ctx.body = "Test 1"; // ... }) .put('/user/:id', function(ctx, next) { ctx.body = "Test 2"; // ... }) .del('/user/:id', function(ctx, next) { ctx.body = "Test 3"; // ... }) .all('/user/:id', function(ctx, next) { ctx.body = "Test 4"; // ... });
router.all('/graphql', GraphQLHTTP({ schema: GraphQLSchema, graphiql: true