Drunk-Venti-Api/pages/api/events/index.js

10 lines
265 B
JavaScript
Raw Normal View History

2022-01-15 18:07:08 +01:00
import {getEvents} from "./utils";
export default async function handler(req, res) {
const events = await getEvents();
if (events) {
res.status(200).json(events);
} else {
res.status(404).json({message: "An error has occured"});
}
}