This commit is contained in:
Cadence Fish
2020-01-15 03:38:33 +13:00
parent b5f163891c
commit 30b45c2573
17 changed files with 157 additions and 26 deletions

View File

@@ -1,3 +1,4 @@
const constants = require("../../lib/constants")
const {fetchUser} = require("../../lib/collectors")
function reply(statusCode, content) {
@@ -9,7 +10,7 @@ function reply(statusCode, content) {
}
module.exports = [
{route: "/api/user/(\\w+)", methods: ["GET"], code: async ({fill}) => {
{route: `/api/user/(${constants.external.username_regex})`, methods: ["GET"], code: async ({fill}) => {
const user = await fetchUser(fill[0])
const data = user.export()
return reply(200, data)