feat(templates): add REST API example on basic template
This commit is contained in:
parent
5386476c85
commit
2435f34bff
1 changed files with 11 additions and 0 deletions
11
templates/basic/routes/api/user.ts
Normal file
11
templates/basic/routes/api/user.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/**
|
||||||
|
* `./routes/api/`
|
||||||
|
* ...is where we put file-based REST API endpoints
|
||||||
|
* this one is accessible via https://<domain>/api/user
|
||||||
|
*/
|
||||||
|
export default eventHandler(() => {
|
||||||
|
return {
|
||||||
|
user: "AYO",
|
||||||
|
date: new Date(),
|
||||||
|
};
|
||||||
|
});
|
Loading…
Reference in a new issue