make all endpoints available
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import { default as api } from "./api/index.js";
|
||||
import { default as gist } from "./api/gist.js";
|
||||
import { default as pin } from "./api/pin.js";
|
||||
import { default as topLangs } from "./api/top-langs.js";
|
||||
import { default as wakatime } from "./api/wakatime.js";
|
||||
import { default as repeatRecent } from "./api/repeat-recent.js";
|
||||
import { default as patInfo } from "./api/pat-info.js";
|
||||
import { default as statusUp } from "./api/status/up.js";
|
||||
|
||||
export default async (req, res) => {
|
||||
// remaining code expects express.js-like request and response objects
|
||||
@@ -19,12 +25,30 @@ export default async (req, res) => {
|
||||
req.query = Object.fromEntries(url.searchParams.entries());
|
||||
|
||||
switch (url.pathname) {
|
||||
case "/gist":
|
||||
case "/api":
|
||||
api(req, res);
|
||||
break;
|
||||
case "/api/gist":
|
||||
gist(req, res);
|
||||
break;
|
||||
case "/pin":
|
||||
case "/api/pin":
|
||||
pin(req, res);
|
||||
break;
|
||||
case "/api/top-langs":
|
||||
topLangs(req, res);
|
||||
break;
|
||||
case "/api/wakatime":
|
||||
wakatime(req, res);
|
||||
break;
|
||||
case "/api/repeat-recent":
|
||||
repeatRecent(req, res);
|
||||
break;
|
||||
case "/api/pat-info":
|
||||
patInfo(req, res);
|
||||
break;
|
||||
case "/api/status/up":
|
||||
statusUp(req, res);
|
||||
break;
|
||||
default:
|
||||
res.statusCode = 404;
|
||||
res.end("Not Found");
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
../api.func/
|
||||
@@ -0,0 +1 @@
|
||||
../api.func/
|
||||
@@ -0,0 +1 @@
|
||||
../api.func/
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"expiration": 5,
|
||||
"bypassToken": "r3fr3shT0k3n-r3fr3shT0k3n-r3fr3shT0k3n",
|
||||
"passQuery": true
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
../api.func/
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"expiration": 5,
|
||||
"bypassToken": "r3fr3shT0k3n-r3fr3shT0k3n-r3fr3shT0k3n",
|
||||
"passQuery": true
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
api.func
|
||||
@@ -1 +0,0 @@
|
||||
api.func
|
||||
Reference in New Issue
Block a user