diff options
| author | LMBishop <13875753+LMBishop@users.noreply.github.com> | 2021-11-21 22:28:51 +0000 |
|---|---|---|
| committer | LMBishop <13875753+LMBishop@users.noreply.github.com> | 2021-11-21 22:28:51 +0000 |
| commit | 6f52ba399d355c4efc477916a05b59ba46b20116 (patch) | |
| tree | f7551867486032aeef9aacf51aac373ac4421b09 | |
| parent | 321a2f6d9e002607590f775f4c4fd24006e71580 (diff) | |
Move cooldown const to constant file
| -rw-r--r-- | app/constants.mjs | 1 | ||||
| -rw-r--r-- | app/directory.mjs | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/app/constants.mjs b/app/constants.mjs index 98b1b03..96068e1 100644 --- a/app/constants.mjs +++ b/app/constants.mjs @@ -2,6 +2,7 @@ export const SERVER_PORT = 3000; export const PARSER_MAX_RECURSION = 20; +export const PURGE_COOLDOWN_MIN = 10; export const PAGES_DIR = 'pages'; export const TEMPLATE_DIR = 'pages/tempates'; export const IMAGES_DIR = 'pages/images'; diff --git a/app/directory.mjs b/app/directory.mjs index 8c0a36e..1fddf23 100644 --- a/app/directory.mjs +++ b/app/directory.mjs @@ -1,14 +1,12 @@ 'use strict'; -import { PAGES_DIR } from './constants.mjs'; +import { PAGES_DIR, PURGE_COOLDOWN_MIN } from './constants.mjs'; import { parse } from './wikiparser.mjs'; import { readFileSync, readdirSync } from 'fs'; const pages = {}; const metadata = {}; -const PURGE_COOLDOWN_MIN = 10; - export function pageFor(path) { path = path.replace(/[^a-z0-9]/gi, '_').toLowerCase(); let page = pages[path]; |
