Skip to content

Commit

Permalink
refactor: update configs properties
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgenyWas committed May 31, 2024
1 parent cd7790b commit f6fecba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
12 changes: 1 addition & 11 deletions configs/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ export const FOOTER_LINKS = [

export const MIN_USER_NAME_LENGTH = 3;

export const SERVER_PATHES = {
routes: {
storage: '/storage/',
},
api: {
public: {},
user: {},
},
};

export const COOKIE_NAMES = {
refreshToken: 'NUXT3_BLOG_RT',
userIdentity: 'NUXT3_BLOG_UI',
Expand All @@ -46,4 +36,4 @@ export const ARTICLE_TOPICS = [
{ name: 'web', title: 'WEB', emoji: '👾' },
];

export const ARTICLE_KEYWORDS = ['api', 'architecture', 'design'] as const;
export const ARTICLE_KEYWORDS = ['api', 'architecture', 'design', 'fundamentals', 'perfomance', 'refactoring'] as const;
3 changes: 1 addition & 2 deletions server/routes/storage/[...].ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// eslint-disable-next-line import/named
import { v2 as cloudinary } from 'cloudinary';
import { SERVER_PATHES } from '~/configs/properties';

export default defineEventHandler((event) => {
let assetUrl;
try {
const { req } = event.node;
const { pathname, searchParams } = new URL(req.url ?? '', `http://${req.headers.host}`);
const path = pathname.replace(SERVER_PATHES.routes.storage, '');
const path = pathname.replace('/storage/', '');
assetUrl = cloudinary.url(path, {
quality: 'auto',
fetch_format: 'auto',
Expand Down

0 comments on commit f6fecba

Please sign in to comment.