Commit 155eda27 authored by Zhanara's avatar Zhanara

мелкие изменения

parent 631cd4b3
This diff is collapsed.
......@@ -22,7 +22,6 @@
"mongoose": "^7.0.3",
"multer": "^1.4.5-lts.1",
"nanoid": "^4.0.2",
"ts-node-dev": "^2.0.0",
"zod": "^3.21.4"
},
"devDependencies": {
......@@ -30,6 +29,7 @@
"@types/cors": "^2.8.13",
"@types/express": "^4.17.17",
"@types/jsonwebtoken": "^9.0.1",
"@types/multer": "^1.4.7"
"@types/multer": "^1.4.7",
"ts-node-dev": "^2.0.0"
}
}
import express, {Express, json, urlencoded} from 'express';
import 'dotenv/config';
import cors from 'cors';
import {mongo} from './repository/mongoose';
import {mongoose} from './repository/mongoose';
import {UsersRouter} from './routes/user';
import { CommentController } from './controllers/comments';
import { PostsController } from './controllers/posts';
mongo.run();
mongoose.run();
const app: Express = express();
app.use(json());
......@@ -15,10 +14,10 @@ app.use(urlencoded({extended: true}));
app.use(express.static('public/uploads'));
app.use('/users', UsersRouter);
app.use('/posts', new PostsController().getRouter())
app.use('/comments', new CommentController().getRouter())
app.use('/comments', new CommentController().getRouter())
app.listen(process.env.PORT, () => {
console.log(`App started on port ${process.env.PORT}`);
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment