-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-server-imports.js
More file actions
41 lines (32 loc) · 1.34 KB
/
test-server-imports.js
File metadata and controls
41 lines (32 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Test server imports step by step
console.log('Testing server imports...');
try {
console.log('1. Testing express import...');
const express = require('express');
console.log('Express imported successfully');
console.log('2. Testing cors import...');
const cors = require('cors');
console.log('Cors imported successfully');
console.log('3. Testing helmet import...');
const helmet = require('helmet');
console.log('Helmet imported successfully');
console.log('4. Testing morgan import...');
const morgan = require('morgan');
console.log('Morgan imported successfully');
console.log('5. Testing dotenv import...');
require('dotenv').config();
console.log('Dotenv configured successfully');
console.log('6. Testing config import...');
const config = require('./src/config');
console.log('Config imported successfully');
console.log('7. Testing routes import...');
const routes = require('./src/routes');
console.log('Routes imported successfully');
console.log('8. Testing error handler import...');
const { errorHandler, notFound } = require('./src/middleware/errorHandler');
console.log('Error handler imported successfully');
console.log('\nAll server imports successful!');
} catch (error) {
console.error('Server import error:', error.message);
console.error('Stack:', error.stack);
}