Buncha changes I CBA
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
'use server'
|
||||
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
|
||||
export async function GET(request:Request, { params }: {params:{slug: string}}){
|
||||
console.log(request);
|
||||
// const url:NextURL = request.url;
|
||||
// console.log(url);
|
||||
console.log(request);
|
||||
console.log(params);
|
||||
|
||||
|
||||
// @ts-ignore
|
||||
cookies().set('name', 'lee');
|
||||
return Response.json({
|
||||
"a": "kanker",
|
||||
"b": params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// export default async function handler(req:NextApiRequest, res:NextApiResponse) {
|
||||
// await MPost.sync();
|
||||
// switch (req.method) {
|
||||
// case 'GET':
|
||||
// const posts = await MPost.findAll();
|
||||
// res.status(200).json(posts);
|
||||
// break;
|
||||
// case 'POST':
|
||||
// try {
|
||||
// const post = await MPost.create({
|
||||
// title: req.body.title,
|
||||
// content: req.body.content,
|
||||
// createdAt: new Date(),
|
||||
// updatedAt: new Date(),
|
||||
// },{ fields: ['title','content'] });
|
||||
// const posts2 = await MPost.findAll();
|
||||
// res.status(200).json(posts2);
|
||||
// } catch (error) {
|
||||
// console.log(error)
|
||||
// }
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user