File tree Expand file tree Collapse file tree 6 files changed +10
-20
lines changed
Expand file tree Collapse file tree 6 files changed +10
-20
lines changed Original file line number Diff line number Diff line change 1- import express from 'express' ;
1+ import { Config } from './src/utils/config.js' ;
2+ import { bootstrap } from './src/init.js' ;
23import lenses from './src/endpoints/explorer/lenses.js' ;
34import categorylenses from './src/endpoints/explorer/category/lenses.js' ;
45import top from './src/endpoints/explorer/top.js' ;
@@ -14,11 +15,7 @@ import importCache from './src/endpoints/import/cache.js';
1415import importLens from './src/endpoints/import/lens.js' ;
1516import v1 from './src/endpoints/v1.js' ;
1617import wildcard from './src/endpoints/wildcard.js' ;
17- import { Config } from './src/utils/config.js' ;
18- import * as init from './src/init.js' ;
19- import * as dotenv from 'dotenv' ;
20-
21- dotenv . config ( ) ;
18+ import express from 'express' ;
2219
2320const enableCacheImport = Config . app . flag . enable_cache_import ;
2421const enableCustomImport = Config . app . flag . enable_custom_import ;
@@ -49,5 +46,5 @@ app.use('*', wildcard);
4946
5047app . listen ( serverPort , ( ) => {
5148 console . info ( `[Info] ✅ Snap Camera Server is running on port ${ serverPort } ` ) ;
52- init . bootstrap ( ) ;
49+ bootstrap ( ) ;
5350} ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,12 @@ import YAML from 'yaml';
22import * as fs from 'fs/promises' ;
33import dotenv from 'dotenv' ;
44
5- dotenv . config ( ) ;
5+ const envConfig = dotenv . config ( ) ;
6+ for ( const key in envConfig . parsed ) {
7+ if ( process . env [ key ] ?. trim ( ) === '' ) {
8+ process . env [ key ] = envConfig . parsed [ key ] ?. trim ( ) || '' ;
9+ }
10+ }
611
712const Config = await loadConfig ( ) ;
813
Original file line number Diff line number Diff line change 11import mysql from 'mysql2' ;
22import { Config } from './config.js' ;
3- import * as dotenv from 'dotenv' ;
43import * as Util from './helper.js' ;
54
6- dotenv . config ( ) ;
7-
85const connection = mysql . createPool ( {
96 host : process . env . DB_HOST ,
107 port : process . env . DB_PORT ,
Original file line number Diff line number Diff line change 11import { SnapLensWebCrawler } from '@ptrumpis/snap-lens-web-crawler' ;
22import { Config } from './config.js' ;
3- import * as dotenv from 'dotenv' ;
43import * as DB from './db.js' ;
54import * as Storage from './storage.js' ;
65
7- dotenv . config ( ) ;
8-
96const relayTimeout = Config . app . relay . timeout ;
107const relayServer = Config . app . relay . server ;
118
Original file line number Diff line number Diff line change 11import JSZip from 'jszip' ;
22import LensFileParser from '@ptrumpis/snap-lens-file-extractor' ;
33import { Config } from './config.js' ;
4- import * as dotenv from 'dotenv' ;
54import * as fs from 'fs/promises' ;
65import * as zstd from 'fzstd' ;
76import * as Storage from './storage.js' ;
87import * as Util from './helper.js' ;
98
10- dotenv . config ( ) ;
11-
129const storageServer = process . env . STORAGE_SERVER ;
1310const storagePath = process . env . STORAGE_PATH ;
1411const mediaDir = process . env . MEDIA_DIR . replace ( / ^ \/ + / , '' ) ;
Original file line number Diff line number Diff line change 11import { SnapLensWebCrawler } from '@ptrumpis/snap-lens-web-crawler' ;
2- import * as dotenv from 'dotenv' ;
32import * as fs from 'fs/promises' ;
43import path from 'path' ;
54import sharp from 'sharp' ;
65import { Config } from './config.js' ;
76
8- dotenv . config ( ) ;
9-
107const storagePath = process . env . STORAGE_PATH ;
118const storageServer = process . env . STORAGE_SERVER ;
129const ignoreAltMedia = Config . app . flag . ignore_alt_media ;
You can’t perform that action at this time.
0 commit comments