#1 added linksRouter

parent 45c84dc2
import express, {Express} from 'express'; import express, {Express} from 'express';
import {linksRouter} from './routes/linksRouter';
const app: Express = express(); const app: Express = express();
// app.use app.use(express.json());
app.use('/links', linksRouter);
app.listen(3000, () => {
console.log(`Server is listening on port 3000`);
});
import express, {Router, Request, Response} from 'express';
export const linksRouter: Router = express.Router();
linksRouter.get('/', (req: Request, res: Response) => {
res.send('Hello');
});
linksRouter.post('/', (req: Request, res: Response) => {
res.send('Hello');
});
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