vite-plugin-api-routes
Version:
A Vite.js plugin that creates API routes by mapping the directory structure, similar to Next.js API Routes. This plugin enhances the functionality for backend development using Vite.
13 lines (12 loc) • 302 B
JavaScript
// src/api-server/handler.ts
import express from "express";
import * as configure from "vite-plugin-api-routes/configure";
var handler = express();
configure.handlerBefore?.(handler);
handler.get("/info", (_, res) => {
res.json("Hellow");
});
configure.handlerAfter?.(handler);
export {
handler
};