diff --git a/src/app.ts b/src/app.ts index b2d573a..0c222b2 100644 --- a/src/app.ts +++ b/src/app.ts @@ -3,7 +3,7 @@ import express from 'express' import mongoose from 'mongoose' import path from 'path' -import routes from './routes' +import routes from './app/routes' const app = express() diff --git a/src/routes.ts b/src/app/routes.ts similarity index 91% rename from src/routes.ts rename to src/app/routes.ts index 562d9be..0fd6192 100644 --- a/src/routes.ts +++ b/src/app/routes.ts @@ -2,6 +2,11 @@ import { Application } from 'express' import Urls from './schema' export default (app: Application) => { + + app.get('/', async(req, res) => { + res.render('home') + }) + app.get('/:id', async (req, res) => { try { const urlObj = await Urls.findById(req.params.id); diff --git a/src/schema.ts b/src/app/schema.ts similarity index 100% rename from src/schema.ts rename to src/app/schema.ts