use compilerPath version
This commit is contained in:
9
src/pages/api/entry/date.ts
Normal file
9
src/pages/api/entry/date.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { APIContext } from "astro";
|
||||
import { httpResponse } from "@util/response";
|
||||
import { getParams } from "@util/http";
|
||||
|
||||
export async function GET({ request }: APIContext) {
|
||||
const params = getParams(request)
|
||||
|
||||
return httpResponse({a: params}, 200)
|
||||
}
|
||||
6
src/utils/http.ts
Normal file
6
src/utils/http.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export function getParams(request: Request) {
|
||||
const params = request.url.split("?")[1]
|
||||
const searchParams = new URLSearchParams(params);
|
||||
const paramsDict = Object.fromEntries(searchParams.entries());
|
||||
return paramsDict
|
||||
}
|
||||
@@ -1,5 +1,13 @@
|
||||
{
|
||||
"extends": "astro/tsconfigs/strict",
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@component/*": ["src/components/*.astro"],
|
||||
"@layout/*": ["src/layout/*.astro"],
|
||||
"@util/*": ["src/utils/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user