From 0f63f32831e781cddbcb8d9a962c2d874d6786d5 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 19 Jul 2024 17:13:40 +0200 Subject: [PATCH] Update index.js --- nodejs/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nodejs/index.js b/nodejs/index.js index 46faf7a..e932bc5 100644 --- a/nodejs/index.js +++ b/nodejs/index.js @@ -5,6 +5,9 @@ fastify.register(require('@fastify/cors')) fastify.get('/', function (req, reply) { return { hello: "from nodejs" } }) +fastify.get('/401', function (req, reply) { + return reply.code(401).header('Content-Type', 'application/json; charset=utf-8').send({ hello: '401' }) +}) fastify.get('/env', function (req, reply) { return { env: process.env } })