aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2022-02-10 14:08:27 -0600
committerMatt Strapp <matt@mattstrapp.net>2022-02-10 14:08:27 -0600
commite2422d7d95eba0528864c317e04fe89c5c10390f (patch)
tree1d43fdb3b885775d0d57e7d5cf758c20500b497f
parentadd debugging (diff)
downloadee4511w-web-e2422d7d95eba0528864c317e04fe89c5c10390f.tar
ee4511w-web-e2422d7d95eba0528864c317e04fe89c5c10390f.tar.gz
ee4511w-web-e2422d7d95eba0528864c317e04fe89c5c10390f.tar.bz2
ee4511w-web-e2422d7d95eba0528864c317e04fe89c5c10390f.tar.lz
ee4511w-web-e2422d7d95eba0528864c317e04fe89c5c10390f.tar.xz
ee4511w-web-e2422d7d95eba0528864c317e04fe89c5c10390f.tar.zst
ee4511w-web-e2422d7d95eba0528864c317e04fe89c5c10390f.zip
fix directory stuffs
Diffstat (limited to '')
-rw-r--r--package.json3
-rw-r--r--src/index.ts5
-rw-r--r--tsconfig.json4
3 files changed, 6 insertions, 6 deletions
diff --git a/package.json b/package.json
index 52f906e..383ed94 100644
--- a/package.json
+++ b/package.json
@@ -41,6 +41,5 @@
"main": "dist/index.js",
"author": "Matt Strapp <matt@mattstrapp.net>",
"license": "MIT",
- "type": "module",
"private": true
-} \ No newline at end of file
+}
diff --git a/src/index.ts b/src/index.ts
index 8ef9a64..e396151 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -2,6 +2,7 @@ import express, { Request, Response } from 'express';
import session from 'express-session';
import rateLimit from 'express-rate-limit';
import slowDown from 'express-slow-down';
+import path from 'path';
import { env } from 'process';
import helmet from 'helmet';
import csurf from 'csurf';
@@ -45,8 +46,8 @@ app.use(helmet());
// Add ejs as view engine
app.set('view engine', 'ejs');
-app.set('views', 'views/pages');
-app.use('/public', express.static('public'));
+app.set('views', path.join(__dirname, 'views/pages'));
+app.use('/public', express.static(path.join(__dirname, 'public')));
app.get('/', csrf, (req: Request, res: Response) => {
res.render('index', {
diff --git a/tsconfig.json b/tsconfig.json
index 9c05f4c..7c90de9 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -21,7 +21,7 @@
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
/* Modules */
- "module": "es6", /* Specify what module code is generated. */
+ "module": "commonjs", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
@@ -93,4 +93,4 @@
"include": [
"src/**/*"
]
-} \ No newline at end of file
+}