update/created routing for pages

This commit is contained in:
Joaquin committed 2025-04-30 17:15:23 -07:00
1 parent 45746aa922
commit 3ef8129196
5 files changed
+228 -7

No files matched your search

+66 -3
View File
@@ -1,9 +1,72 @@
const express = require("express");
const path = require("path");
const express = require('express');
const path = require('path');
const app = express();
const port = 8000;
app.set('view engine', 'ejs');
app.set('views',path.join(__dirname, 'views'));
/*
ROUTINGS
*/
app.get('/', (req, res) => {
res.render('index');
});
app.get('/signup', (req, res) => {
res.render('signup');
});
app.get('/login', (req, res) => {
res.render('login');
});
app.get('/home', (req, res) => {
res.render('home');
});
app.get('/assets', (req, res) => {
res.render('assets');
});
app.get('/plans', (req, res) => {
res.render('plans');
});
app.get('/more', (req, res) => {
res.render('more');
});
app.get('/profile', (req, res) => {
res.render('profiles');
});
app.get('/settings', (req, res) => {
res.render('settings');
});
app.get('/aboutUs', (req, res) => {
res.render('aboutUs');
});
app.post('/signup', (req, res) => {
res.status(200);
res.send('200 status code');
});
app.post('/login', (req, res) => {
res.status(200);
res.send('200 status code');
});
app.get('/*splat', (req, res) => {
res.status(404);
res.send('404 Not Found');
});
app.listen(port, () => {
console.log(`Server listening on port ${port}`);
console.log(`Server listening on port ${port}`);
});
+12
View File
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1>Welcome!</h1>
<form method="get" action="/signup">
<button type="submit">signup</button>
</form>
</body>
</html>
+9
View File
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>SIGNUP</h1>
</body>
</html>