Skip to content

Commit

Permalink
Merge pull request #243 from sametcodes/239-implementing-caching-on-t…
Browse files Browse the repository at this point in the history
…he-view-api

feat(#239): applied caching control to the public view API
  • Loading branch information
sametcodes authored Mar 21, 2024
2 parents 7d01bcb + bf01e00 commit ead694e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/api/view/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {
validatePublicRequest,
validatePublicBody,
} from "@/middlewares/api/public";
// import { setCacheControl } from "@/middlewares/api/cache";
import { setCacheControl } from "@/middlewares/api/cache";
import handlePlatformAPI from "@/services/api/handler";

export default nextConnect()
.use(validatePublicRequest)
.use(validatePublicBody)
.use(resolveHandler)
// .use(setCacheControl)
.use(setCacheControl)
.get((req: NextApiRequest, res: NextApiResponse) => {
const { services, templates, query, config } = res.locals;
return handlePlatformAPI(services, templates, query, config)(req, res);
Expand Down

0 comments on commit ead694e

Please sign in to comment.