Feat: refactor routes.js express entrypoint config
Feat: express config script refactor Feat: add state and settingsCache files
This commit is contained in:
parent
c3f8f98c26
commit
85235eaa13
22 changed files with 807 additions and 1 deletions
19
lib/middlewares/settingsCache.js
Normal file
19
lib/middlewares/settingsCache.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
const state = require('./state')
|
||||
|
||||
const getTimestamp = () => state.settingsCache.timestamp
|
||||
|
||||
const getCache = () => state.settingsCache.cache
|
||||
|
||||
const setTimestamp = (newTimestamp) => state.settingsCache.timestamp = newTimestamp
|
||||
|
||||
const setCache = (newCache) => state.settingsCache.cache = newCache
|
||||
|
||||
const clearCache = () => state.settingsCache.cache = null
|
||||
|
||||
module.exports = {
|
||||
getTimestamp,
|
||||
getCache,
|
||||
setTimestamp,
|
||||
setCache,
|
||||
clearCache
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue