<commit_before>// Dragon Endpoints

const express = require("express")
const v2 = express.Router()
const asyncHandle = require("express-async-handler")

// Returns all Dragon data
v2.get("/", asyncHandle(async (req, res) => {
  const data = await global.db
    .collection("dragon")
    .find({},{"_id": 0 })
    .toArray()
  res.json(data)
}))

// Returns specific Dragon data
v2.get("/:capsule", asyncHandle(async (req, res) => {
  const capsule = req.params.capsule
  const data = global.db
    .collection("dragon")
    .find({"id": capsule},{"_id": 0 })
    .toArray()
  res.json(data[0])<commit_msg>addded missing await statement in capsules<commit_after>// Dragon Endpoints

const express = require("express")
const v2 = express.Router()
const asyncHandle = require("express-async-handler")

// Returns all Dragon data
v2.get("/", asyncHandle(async (req, res) => {
  const data = await global.db
    .collection("dragon")
    .find({},{"_id": 0 })
    .toArray()
  res.json(data)
}))

// Returns specific Dragon data
v2.get("/:capsule", asyncHandle(async (req, res) => {
  const capsule = req.params.capsule
  const data = await global.db
    .collection("dragon")
    .find({"id": capsule},{"_id": 0 })
    .toArray()
  res.json(data[0])
{'fraction_non_alphanumeric': 0.1783132530120482, 'fraction_numerical': 0.00963855421686747, 'mean_word_length': 3.848249027237354, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 7, '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': '6411165', 'n_tokens_mistral': 417, 'n_tokens_neox': 408, 'n_words': 103}