0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-04 01:42:42 +00:00

renaming "get" functions

rename `getStaticTheme` to `getStaticThemeCSS`
rename `getBrewThemeWithCSS` to `getBrewThemeCSS`
rename `getBrewThemeParent` to `getBrewThemeParentCSS`

to avoid confusion with other "get" endpoints like `getBrew`, and unify naming for endpoint functions that return CSS.

Simplify `isStaticTheme` function (getting the parent theme is handled elsewhere)
This commit is contained in:
Trevor Buckner
2024-07-10 14:15:03 -04:00
parent 656edb07ea
commit a247e50c9f
3 changed files with 29 additions and 31 deletions

View File

@@ -9,7 +9,7 @@ const yaml = require('js-yaml');
const app = express();
const config = require('./config.js');
const { homebrewApi, getBrew, getBrewThemeWithCSS, getStaticTheme, getBrewThemeParent } = require('./homebrew.api.js');
const { homebrewApi, getBrew, getBrewThemeCSS, getStaticThemeCSS, getBrewThemeParentCSS } = require('./homebrew.api.js');
const GoogleActions = require('./googleActions.js');
const serveCompressedStaticAssets = require('./static-assets.mv.js');
const sanitizeFilename = require('sanitize-filename');
@@ -79,9 +79,9 @@ app.get('/robots.txt', (req, res)=>{
// Theme
app.get('/css/:id', asyncHandler(getBrew('theme', false)), asyncHandler(getBrewThemeWithCSS));
app.get('/css/:engine/:id/', asyncHandler(getStaticTheme));
app.get('/cssParent/:id', asyncHandler(getBrew('theme', false)), asyncHandler(getBrewThemeParent));
app.get('/css/:id', asyncHandler(getBrew('theme', false)), asyncHandler(getBrewThemeCSS));
app.get('/css/:engine/:id/', asyncHandler(getStaticThemeCSS));
app.get('/cssParent/:id', asyncHandler(getBrew('theme', false)), asyncHandler(getBrewThemeParentCSS));
//Home page