<commit_before>/**
 * Created by <NAME> on 12/1/2016.
 */

const Router = require('koa-router')
const courseInfoGetter = require('../tasks/get_course_info')
const getCourseList = courseInfoGetter.getCourseList
const getCourse = courseInfoGetter.getCourse

const router = new Router({
  prefix: '/learnhelper'
})

router.post('/:username/courses', async(ctx) => {
  const {username} = ctx.params
  const courses = await getCourseList(username)

  ctx.body = {
    courses: courses.toObject()
  }
})

router.post('/:username/courses/:courseID/notices', async (ctx) => {
  const {username,courseID} = ctx.params
  const course = await getCourse(username, courseID)
  ctx.body = {
    notices: course.toObject().notices
  }
})

exports.router = router<commit_msg>fix notices<commit_after>/**
 * Created by <NAME> on 12/1/2016.
 */

const Router = require('koa-router')
const courseInfoGetter = require('../tasks/get_course_info')
const getCourseList = courseInfoGetter.getCourseList
const getCourse = courseInfoGetter.getCourse

const router = new Router({
  prefix: '/learnhelper'
})

router.post('/:username/courses', async(ctx) => {
  const {username} = ctx.params
  const courses = await getCourseList(username)

  ctx.body = {
    courses: courses.toObject()
  }
})

router.post('/:username/courses/:courseID/notices', async (ctx) => {
  const {username,courseID} = ctx.params
  const course = await getCourse(username, courseID)
  ctx.body = {
    notices: course.notices.toObject()
  }
})

exports.router = router
{'fraction_non_alphanumeric': 0.14511873350923482, 'fraction_numerical': 0.009234828496042216, 'mean_word_length': 4.417857142857143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1044167', 'n_tokens_mistral': 506, 'n_tokens_neox': 494, 'n_words': 104}