{"size": 540, "ext": "js", "max_stars_repo_path": "grapgql-server/routes/index.js", "max_stars_repo_name": "wayshon/graphql-practise", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "grapgql-server/routes/index.js", "max_issues_repo_name": "wayshon/graphql-practise", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "grapgql-server/routes/index.js", "max_forks_repo_name": "wayshon/graphql-practise", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.0, "max_line_length": 56, "alphanum_fraction": 0.6074074074}
const router = require('koa-router')()

router.get('/', async (ctx, next) => {
  await ctx.render('index', {
    title: 'Hello Koa 2!'
  })
})

router.get('/string', async (ctx, next) => {
  ctx.body = 'koa2 string'
})

router.get('/json', async (ctx, next) => {
  ctx.body = {
    title: 'koa2 json'
  }
})

const { graphqlKoa } = require('graphql-server-koa');

const schema = require('../schema');

router.post('/graphql', graphqlKoa({ schema: schema }));
router.get('/graphql', graphqlKoa({ schema: schema }));

module.exports = router
