Compare commits

..

3 Commits

Author SHA1 Message Date
9d0a0a9cab Fixed path issues
All checks were successful
Build and publish / Git Tag (push) Successful in 3s
Build and publish / Build Container (push) Successful in 18s
2025-04-17 12:21:41 -04:00
f89b1721f9 Fixed environment setup
All checks were successful
Build and publish / Git Tag (push) Successful in 3s
Build and publish / Build Container (push) Successful in 20s
2025-04-17 12:19:56 -04:00
b3206a9874 Fixed environment setup 2025-04-17 12:19:14 -04:00
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
FROM node:alpine FROM node:alpine
ARG PORT ARG PORT="3000"
ENV PORT=$PORT ENV PORT=$PORT
COPY . . COPY . .

View File

@ -7,9 +7,9 @@ dotenv.config();
dotenv.config({path: '.env.local', override: true}); dotenv.config({path: '.env.local', override: true});
export const environment = { export const environment = {
port: process.env['PORT'] ?? 3000, port: process.env['PORT'] ? +process.env['PORT'] : 3000,
production: !process.env.NODE_ENV || ['prod', 'production'].includes(process.env.NODE_ENV.toLowerCase()), production: !process.env.NODE_ENV || ['prod', 'production'].includes(process.env.NODE_ENV.toLowerCase()),
tickers: process.env['TICKERS']?.split(',') ?? [], tickers: process.env['TICKERS']?.split(',') || [],
token: process.env['TOKEN'], token: process.env['TOKEN'],
version: packageJson.version version: packageJson.version
} }

View File

@ -27,7 +27,7 @@ let shuttingDown = false;
}); });
}); });
app.get('/', errorHandler(async (req, res) => { app.get('*', errorHandler(async (req, res) => {
const results = await Promise.all(environment.tickers.map(ticker => const results = await Promise.all(environment.tickers.map(ticker =>
fetch(`https://finnhub.io/api/v1/quote?symbol=${ticker}&token=${environment.token}`) fetch(`https://finnhub.io/api/v1/quote?symbol=${ticker}&token=${environment.token}`)
.then(resp => resp.json()))); .then(resp => resp.json())));