Had to be put
This commit is contained in:
parent
170a019bca
commit
a25323b0ee
1 changed files with 4 additions and 3 deletions
|
@ -28,13 +28,13 @@ Bun.serve({
|
|||
async GET(req) {
|
||||
if (!isAuthenticated(req)) return unauthorizedResp();
|
||||
|
||||
const entries = await drizzleDB.select({ id: entry.id, name: entry.name, finished: entry.finished, updated_at: entry.updatedAt}).from(entry).orderBy(desc(entry.updatedAt));
|
||||
const entries = await drizzleDB.select({ id: entry.id, name: entry.name, finished: entry.finished, updated_at: entry.updatedAt }).from(entry).orderBy(desc(entry.updatedAt));
|
||||
|
||||
return new Response(JSON.stringify(entries), {
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
},
|
||||
async POST(req) {
|
||||
async PUT(req) {
|
||||
if (!isAuthenticated(req)) return unauthorizedResp();
|
||||
|
||||
const body = await getEntryFromReq(req);
|
||||
|
@ -121,6 +121,7 @@ Bun.serve({
|
|||
reusePort: true,
|
||||
port: env.PORT || 3000,
|
||||
// async fetch(req, server) {
|
||||
// console.log(req);
|
||||
// return new Response("Not found", { status: 404 });
|
||||
// },
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue