blob: 15887837388f24b1cc4e0051ce60bc92fb0fb466 [file] [log] [blame]
import { fastify } from "fastify";
import { fastifyDubboPlugin } from "@apachedubbo/dubbo-fastify";
import routes from "./dubbo";
import cors from "@fastify/cors";
async function main() {
const server = fastify();
await server.register(fastifyDubboPlugin, {
routes,
});
await server.register(cors, {
origin: true,
});
server.get("/", (_, reply) => {
reply.type("text/plain");
reply.send("Hello World!");
});
await server.listen({ host: "localhost", port: 8080 });
console.log("server is listening at", server.addresses());
}
void main();