mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-08-05 07:18:43 +00:00
feat(app): revert port & network changes
This commit is contained in:
@ -3,11 +3,10 @@ import express from 'express';
|
||||
import cors from 'cors';
|
||||
import http from 'http';
|
||||
import routes from './routes';
|
||||
import { getBindAddress, getPort } from './config';
|
||||
import { getPort } from './config';
|
||||
import logger from './utils/logger';
|
||||
|
||||
const port = getPort();
|
||||
const bindAddress = getBindAddress();
|
||||
|
||||
const app = express();
|
||||
const server = http.createServer(app);
|
||||
@ -24,7 +23,7 @@ app.get('/api', (_, res) => {
|
||||
res.status(200).json({ status: 'ok' });
|
||||
});
|
||||
|
||||
server.listen(port, bindAddress, () => {
|
||||
server.listen(port, () => {
|
||||
logger.info(`Server is running on port ${port}`);
|
||||
});
|
||||
|
||||
|
@ -7,7 +7,6 @@ const configFileName = 'config.toml';
|
||||
interface Config {
|
||||
GENERAL: {
|
||||
PORT: number;
|
||||
BIND_ADDRESS: string;
|
||||
SIMILARITY_MEASURE: string;
|
||||
};
|
||||
API_KEYS: {
|
||||
@ -31,8 +30,6 @@ const loadConfig = () =>
|
||||
|
||||
export const getPort = () => loadConfig().GENERAL.PORT;
|
||||
|
||||
export const getBindAddress = () => loadConfig().GENERAL.BIND_ADDRESS;
|
||||
|
||||
export const getSimilarityMeasure = () =>
|
||||
loadConfig().GENERAL.SIMILARITY_MEASURE;
|
||||
|
||||
|
Reference in New Issue
Block a user