From 2435f34bff8e202ce6d4c4ef9d0ed4bf77cc8e21 Mon Sep 17 00:00:00 2001 From: Ayo Date: Tue, 24 Oct 2023 13:13:01 +0200 Subject: [PATCH] feat(templates): add REST API example on basic template --- templates/basic/routes/api/user.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 templates/basic/routes/api/user.ts diff --git a/templates/basic/routes/api/user.ts b/templates/basic/routes/api/user.ts new file mode 100644 index 0000000..73d2695 --- /dev/null +++ b/templates/basic/routes/api/user.ts @@ -0,0 +1,11 @@ +/** + * `./routes/api/` + * ...is where we put file-based REST API endpoints + * this one is accessible via https:///api/user + */ +export default eventHandler(() => { + return { + user: "AYO", + date: new Date(), + }; +});