update: added ttt to nginx configuration

This commit is contained in:
Maieul BOYER 2025-12-22 14:56:39 +01:00 committed by apetitco
parent 5a884ef4c5
commit c71d332c39
2 changed files with 15 additions and 1 deletions

View file

@ -0,0 +1,14 @@
#forward the post request to the microservice
location /api/ttt/ {
proxy_pass http://app-tic-tac-toe;
}
location /api/ttt/socket.io/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_read_timeout 3600s;
proxy_pass http://app-tic-tac-toe;
}

View file

@ -18,7 +18,7 @@ const fastifySocketIO: FastifyPluginAsync = fp(async (fastify) => {
}
fastify.decorate(
'io',
new Server(fastify.server, { path: '/api/chat/socket.io' }),
new Server(fastify.server, { path: '/api/ttt/socket.io' }),
);
fastify.addHook('preClose', defaultPreClose);
fastify.addHook('onClose', (instance: FastifyInstance, done) => {