diff --git a/server/dir/index.html b/server/dir/index.html new file mode 100644 index 0000000..8f2bfd0 --- /dev/null +++ b/server/dir/index.html @@ -0,0 +1,11 @@ + + + + + + Document + + + Hello World + + \ No newline at end of file diff --git a/server/dir/index.js b/server/dir/index.js index 23044d1..6883670 100644 --- a/server/dir/index.js +++ b/server/dir/index.js @@ -14,8 +14,8 @@ const corsOptions = { origin: 'https://jatin-raghav.vercel.app/', // Allow only this origin optionsSuccessStatus: 200 // Some legacy browsers choke on 204 }; -app.use((req, res, next) => { - res.json({ message: 'Hello World' }); +app.use('/', (req, res, next) => { + res.sendFile('index.html', { root: __dirname }); }); app.use((0, cors_1.default)()); app.use(express_1.default.json()); diff --git a/server/src/index.html b/server/src/index.html new file mode 100644 index 0000000..8f2bfd0 --- /dev/null +++ b/server/src/index.html @@ -0,0 +1,11 @@ + + + + + + Document + + + Hello World + + \ No newline at end of file diff --git a/server/src/index.ts b/server/src/index.ts index ae253d6..40e4553 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -12,8 +12,8 @@ const corsOptions = { optionsSuccessStatus: 200 // Some legacy browsers choke on 204 }; -app.use((req, res, next) => { - res.json({message: 'Hello World'}) +app.use('/',(req, res, next) => { + res.sendFile('index.html', {root: __dirname}); }) app.use(cors()); app.use(express.json());