Skip to content
This repository has been archived by the owner on Nov 17, 2024. It is now read-only.

Commit

Permalink
new uploads path app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
vehbiOzcan authored Apr 19, 2024
1 parent a0a3c79 commit d6ea2d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion v1/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const dotenv = require('dotenv');
const errorHandler = require('./middlewares/errorHandler');
const notFound = require('./middlewares/notFound');

const directory = path.join(__dirname, '../../../../../../aicostsqo-static/uploads');
//console.log(directory);
//console.log(__dirname);
dotenv.config({
path: './config/.env', //dotenv config içerisine config dosyamızın path ini verdik
});
Expand All @@ -35,7 +38,10 @@ app.listen(process.env.APP_PORT, () => {
res.send('Hello World');
});
app.use('/api', require('./routes'));
app.use('/api/uploads', express.static(path.join(__dirname, 'uploads')));
//eski static directory
//app.use('/api/uploads', express.static(path.join(__dirname, 'uploads')));
//yeni lokasyon konfigurasyonu
app.use('/api/uploads', express.static(directory));
app.use(notFound);
app.use(errorHandler);
});

0 comments on commit d6ea2d4

Please sign in to comment.