cambios de desarrollo
This commit is contained in:
@@ -13,6 +13,7 @@ dotenv.config({ path: path.resolve(__dirname, '.env'), override: true });
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 3001;
|
||||
const HOST = process.env.HOST || "127.0.0.1";
|
||||
const uploadsDir = path.resolve(__dirname, 'uploads');
|
||||
|
||||
app.set('trust proxy', 1);
|
||||
@@ -88,6 +89,17 @@ const limiter = rateLimit({
|
||||
legacyHeaders: false,
|
||||
message: "Too many requests from this IP, please try again after 15 minutes"
|
||||
});
|
||||
app.get(["/health", "/healthcheck"], (req, res) => {
|
||||
res.set("Cache-Control", "no-store");
|
||||
res.status(200).json({
|
||||
status: "ok",
|
||||
service: "node-gestion-api",
|
||||
pid: process.pid,
|
||||
uptime_seconds: Math.floor(process.uptime()),
|
||||
timestamp_utc: new Date().toISOString()
|
||||
});
|
||||
});
|
||||
|
||||
app.use(limiter);
|
||||
|
||||
// Routes
|
||||
|
||||
Reference in New Issue
Block a user