changed logic in index.ts

parent 19b39506
import express, {Express, Request, Response} from 'express'; import express, {Express, Request, Response} from 'express';
import {linksRouter} from './routes/links.router'; import {linksRouter} from './routes/links.router';
import {collections, connectToDatabase} from './services/database.service'; import {collections, connectToDatabase} from './services/database.service';
import cors from 'cors';
const app: Express = express(); const app: Express = express();
app.use(express.json()); app.use(express.json());
app.use(cors());
app.use('/links', linksRouter); app.use('/links', linksRouter);
connectToDatabase() connectToDatabase()
......
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