aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.ts
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2022-02-09 17:22:30 -0600
committerMatt Strapp <matt@mattstrapp.net>2022-02-09 17:37:37 -0600
commit5c662ac5b4f6664d4d0a1d501d7d2fa2f2fc0621 (patch)
treef3296766c72e951946ec4c986e382299682c3a6b /src/index.ts
parentStart rewriting the entire app (diff)
downloadee4511w-web-5c662ac5b4f6664d4d0a1d501d7d2fa2f2fc0621.tar
ee4511w-web-5c662ac5b4f6664d4d0a1d501d7d2fa2f2fc0621.tar.gz
ee4511w-web-5c662ac5b4f6664d4d0a1d501d7d2fa2f2fc0621.tar.bz2
ee4511w-web-5c662ac5b4f6664d4d0a1d501d7d2fa2f2fc0621.tar.lz
ee4511w-web-5c662ac5b4f6664d4d0a1d501d7d2fa2f2fc0621.tar.xz
ee4511w-web-5c662ac5b4f6664d4d0a1d501d7d2fa2f2fc0621.tar.zst
ee4511w-web-5c662ac5b4f6664d4d0a1d501d7d2fa2f2fc0621.zip
Start rewriting the entire app
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/index.ts b/src/index.ts
new file mode 100644
index 0000000..09126ca
--- /dev/null
+++ b/src/index.ts
@@ -0,0 +1,26 @@
+import express, { Request, Response } from 'express';
+import path from 'path';
+import { env } from 'process';
+
+const app = express();
+
+const port = env.PORT || 2000;
+
+app.set('view engine', 'ejs');
+app.set('views', path.join(__dirname, 'views/pages'));
+app.use('/public', express.static(path.join(__dirname, 'public')));
+
+
+app.get('/', (req: Request, res: Response) => {
+ res.render('index', {
+ errors: [],
+ });
+});
+
+app.get('/about', (req: Request, res: Response) => {
+ res.render('about');
+});
+
+app.listen(port, () => {
+ console.log(`Server is listening on port ${port}`);
+}); \ No newline at end of file