feat(server): allow single method API routes (#24)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export function GET() {
|
||||
return new Response("Get fresh!", {
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function NOTAMETHOD() {
|
||||
return new Response("unreachable");
|
||||
}
|
||||
@@ -5,3 +5,11 @@ export default () => {
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export function GET() {
|
||||
return new Response("Get fresh!", {
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,15 +2,17 @@
|
||||
// This file SHOULD be checked into source version control.
|
||||
// To update this file, run `fresh routes`.
|
||||
|
||||
import * as $0 from "./pages/api/name.ts";
|
||||
import * as $1 from "./pages/[name].tsx";
|
||||
import * as $2 from "./pages/index.tsx";
|
||||
import * as $0 from "./pages/index.tsx";
|
||||
import * as $1 from "./pages/api/get_only.ts";
|
||||
import * as $2 from "./pages/api/name.ts";
|
||||
import * as $3 from "./pages/[name].tsx";
|
||||
|
||||
const routes = {
|
||||
pages: {
|
||||
"./pages/api/name.ts": $0,
|
||||
"./pages/[name].tsx": $1,
|
||||
"./pages/index.tsx": $2,
|
||||
"./pages/index.tsx": $0,
|
||||
"./pages/api/get_only.ts": $1,
|
||||
"./pages/api/name.ts": $2,
|
||||
"./pages/[name].tsx": $3,
|
||||
},
|
||||
baseUrl: import.meta.url,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user