Skip to content

Commit

Permalink
feat: query products and cities info
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Mar 14, 2024
1 parent 2a1acfe commit 3a0c2f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/api/info/cities.get.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { cities } from '~/utils/cities';

export default defineEventHandler(async (event) => {
setHeader(event, 'cache-control', `max-age=${3600 * 24}`);
return cities;
});
6 changes: 6 additions & 0 deletions server/api/info/products.get.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { products } from '~/utils/cities';

export default defineEventHandler(async (event) => {
setHeader(event, 'cache-control', `max-age=${3600 * 24}`);
return products;
});

0 comments on commit 3a0c2f3

Please sign in to comment.