vyles commited on
Commit
979deb4
Β·
verified Β·
1 Parent(s): 2575541

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +5 -3
index.js CHANGED
@@ -239,8 +239,8 @@ app.use((err, req, res, next) => {
239
  });
240
  });
241
 
242
- // 404 handler
243
- app.use('*', (req, res) => {
244
  res.status(404).json({
245
  success: false,
246
  message: 'Endpoint not found'
@@ -252,4 +252,6 @@ app.listen(PORT, () => {
252
  console.log(`πŸš€ Content Extractor API running on port ${PORT}`);
253
  console.log(`πŸ“– API Documentation: http://localhost:${PORT}`);
254
  console.log(`πŸ₯ Health Check: http://localhost:${PORT}/health`);
255
- });
 
 
 
239
  });
240
  });
241
 
242
+ // 404 handler - fix untuk path-to-regexp error
243
+ app.use((req, res) => {
244
  res.status(404).json({
245
  success: false,
246
  message: 'Endpoint not found'
 
252
  console.log(`πŸš€ Content Extractor API running on port ${PORT}`);
253
  console.log(`πŸ“– API Documentation: http://localhost:${PORT}`);
254
  console.log(`πŸ₯ Health Check: http://localhost:${PORT}/health`);
255
+ });
256
+
257
+ export default app;