mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-20 13:48:20 +02:00
[dyad] wrote 5 file(s)
This commit is contained in:
1 parent
204e66dd3a
commit
f45cfb36e0
5 files changed
+40
-23
No files matched your search
@@ -2,13 +2,35 @@ const express = require('express');
|
||||
const cors = require('cors');
|
||||
const helmet = require('helmet');
|
||||
const path = require('path');
|
||||
const { db, logger } = require('./config/database');
|
||||
const winston = require('winston');
|
||||
const { db } = require('./config/database');
|
||||
|
||||
// Configure logger
|
||||
const logger = winston.createLogger({
|
||||
level: 'info',
|
||||
format: winston.format.combine(
|
||||
winston.format.timestamp(),
|
||||
winston.format.json()
|
||||
),
|
||||
transports: [
|
||||
new winston.transports.Console()
|
||||
]
|
||||
});
|
||||
|
||||
// Create Express app
|
||||
const app = express();
|
||||
|
||||
// Middleware
|
||||
app.use(helmet());
|
||||
app.use(helmet({
|
||||
contentSecurityPolicy: {
|
||||
directives: {
|
||||
defaultSrc: ["'self'"],
|
||||
scriptSrc: ["'self'", "'unsafe-inline'"],
|
||||
styleSrc: ["'self'", "'unsafe-inline'"],
|
||||
imgSrc: ["'self'", "data:"],
|
||||
}
|
||||
}
|
||||
}));
|
||||
app.use(cors());
|
||||
app.use(express.json());
|
||||
app.use(express.static('public'));
|
||||
|
||||
Reference in new issue
Block a user