Skip to content

Commit

Permalink
feat(server): add fastify
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocroh committed May 15, 2024
1 parent b8cddbb commit 2d63dbd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apps/server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import WebSocket, { WebSocketServer } from "ws";
import Http from "http";
import { v4 as uuid } from "uuid";
import Fastify from "fastify";

const fastify = Fastify({
logger: true,
});

import cron from "node-cron";

const server = Http.createServer();
Expand Down Expand Up @@ -148,3 +154,15 @@ server.listen(4000, () => {
// });
// }
// });
//

fastify.get("/", function (_, reply) {
reply.send({ hello: "world" });
});

fastify.listen({ port: 4001 }, function (err, address) {
if (err) {
fastify.log.error(err);
process.exit(1);
}
});

0 comments on commit 2d63dbd

Please sign in to comment.