// main.ts
import multer from 'multer';
const app = express();
export const storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, 'uploads/');
},
filename: function (req, file, cb) {
cb(null, file.fieldname + '-' + Date.now());
}
});
const upload = multer({ storage: storage });
app.use(express.json());
app.use(cors());
или тебе шаблонизатор Pug нужен?