mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-09-20 14:32:57 +00:00
simplify imports as suggested
This commit is contained in:
+5
-19
@@ -16,11 +16,11 @@ import path from 'path';
|
|||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
|
|
||||||
import api from './homebrew.api.js';
|
import api from './homebrew.api.js';
|
||||||
import pageRoutes from './page-routes.js';
|
const { homebrewApi, getBrew, getCSS } = api;
|
||||||
const { homebrewApi, getBrew, getUsersBrewThemes, getCSS } = api;
|
|
||||||
import adminApi from './admin.api.js';
|
import adminApi from './admin.api.js';
|
||||||
import vaultApi from './vault.api.js';
|
import vaultApi from './vault.api.js';
|
||||||
import GoogleActions from './googleActions.js';
|
import pageRoutes from './page-routes.js';
|
||||||
|
|
||||||
import serveCompressedStaticAssets from './static-assets.mv.js';
|
import serveCompressedStaticAssets from './static-assets.mv.js';
|
||||||
import asyncHandler from 'express-async-handler';
|
import asyncHandler from 'express-async-handler';
|
||||||
import { model as HomebrewModel } from './homebrew.model.js';
|
import { model as HomebrewModel } from './homebrew.model.js';
|
||||||
@@ -113,12 +113,6 @@ export default async function createApp(vite) {
|
|||||||
app.use(adminApi(vite));
|
app.use(adminApi(vite));
|
||||||
app.use(vaultApi);
|
app.use(vaultApi);
|
||||||
|
|
||||||
const welcomeText = fs.readFileSync('./client/homebrew/pages/homePage/welcome_msg.md', 'utf8');
|
|
||||||
const welcomeTextLegacy = fs.readFileSync('./client/homebrew/pages/homePage/welcome_msg_legacy.md', 'utf8');
|
|
||||||
const migrateText = fs.readFileSync('./client/homebrew/pages/homePage/migrate.md', 'utf8');
|
|
||||||
const changelogText = fs.readFileSync('changelog.md', 'utf8');
|
|
||||||
const faqText = fs.readFileSync('faq.md', 'utf8');
|
|
||||||
|
|
||||||
String.prototype.replaceAll = function(s, r){return this.split(s).join(r);};
|
String.prototype.replaceAll = function(s, r){return this.split(s).join(r);};
|
||||||
|
|
||||||
const defaultMetaTags = {
|
const defaultMetaTags = {
|
||||||
@@ -131,16 +125,8 @@ export default async function createApp(vite) {
|
|||||||
|
|
||||||
app.use(pageRoutes({
|
app.use(pageRoutes({
|
||||||
defaultMetaTags,
|
defaultMetaTags,
|
||||||
welcomeText,
|
HomebrewModel,
|
||||||
welcomeTextLegacy,
|
sanitizeBrew,
|
||||||
migrateText,
|
|
||||||
changelogText,
|
|
||||||
faqText,
|
|
||||||
getBrew,
|
|
||||||
getUsersBrewThemes,
|
|
||||||
HomebrewModel,
|
|
||||||
GoogleActions,
|
|
||||||
sanitizeBrew,
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
//Robots.txt
|
//Robots.txt
|
||||||
|
|||||||
+10
-8
@@ -15,18 +15,20 @@ import dbCheck from './middleware/dbCheck.js';
|
|||||||
import sanitizeFilename from 'sanitize-filename';
|
import sanitizeFilename from 'sanitize-filename';
|
||||||
import { DEFAULT_BREW } from './brewDefaults.js';
|
import { DEFAULT_BREW } from './brewDefaults.js';
|
||||||
import { splitTextStyleAndMetadata } from '../shared/helpers.js';
|
import { splitTextStyleAndMetadata } from '../shared/helpers.js';
|
||||||
|
import GoogleActions from './googleActions.js';
|
||||||
|
|
||||||
|
import api from './homebrew.api.js';
|
||||||
|
const { getBrew, getUsersBrewThemes } = api;
|
||||||
|
|
||||||
|
const welcomeText = fs.readFileSync('./client/homebrew/pages/homePage/welcome_msg.md', 'utf8');
|
||||||
|
const welcomeTextLegacy = fs.readFileSync('./client/homebrew/pages/homePage/welcome_msg_legacy.md', 'utf8');
|
||||||
|
const migrateText = fs.readFileSync('./client/homebrew/pages/homePage/migrate.md', 'utf8');
|
||||||
|
const changelogText = fs.readFileSync('changelog.md', 'utf8');
|
||||||
|
const faqText = fs.readFileSync('faq.md', 'utf8');
|
||||||
|
|
||||||
export default function pageRoutes({
|
export default function pageRoutes({
|
||||||
defaultMetaTags,
|
defaultMetaTags,
|
||||||
welcomeText,
|
|
||||||
welcomeTextLegacy,
|
|
||||||
migrateText,
|
|
||||||
changelogText,
|
|
||||||
faqText,
|
|
||||||
getBrew,
|
|
||||||
getUsersBrewThemes,
|
|
||||||
HomebrewModel,
|
HomebrewModel,
|
||||||
GoogleActions,
|
|
||||||
sanitizeBrew,
|
sanitizeBrew,
|
||||||
}) {
|
}) {
|
||||||
const app = express.Router();
|
const app = express.Router();
|
||||||
|
|||||||
Reference in New Issue
Block a user