24 lines
538 B
TypeScript
24 lines
538 B
TypeScript
/**
|
|
* Standalone server for the Files module.
|
|
* Serves rfiles.online independently.
|
|
*/
|
|
|
|
import { Hono } from "hono";
|
|
import { serveStatic } from "hono/bun";
|
|
import { filesModule } from "./mod";
|
|
|
|
const app = new Hono();
|
|
|
|
// Serve static module assets
|
|
app.use("/modules/files/*", serveStatic({ root: "./dist" }));
|
|
app.use("/*", serveStatic({ root: "./dist" }));
|
|
|
|
// Mount files routes at root
|
|
app.route("/", filesModule.routes);
|
|
|
|
console.log(`[rFiles Standalone] Listening on :3000`);
|
|
export default {
|
|
port: 3000,
|
|
fetch: app.fetch,
|
|
};
|