Fixed paths
This commit is contained in:
@@ -2,7 +2,7 @@ import { config } from 'dotenv'
|
||||
import { resolve, dirname } from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
||||
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '../..')
|
||||
|
||||
export function cfg() {
|
||||
config({ path: resolve(ROOT, '.env'), override: true })
|
||||
|
||||
@@ -14,10 +14,10 @@ import {refreshForecast} from './forecast.mjs';
|
||||
|
||||
const app = express();
|
||||
const DIR = dirname(fileURLToPath(import.meta.url));
|
||||
const CLIENT_DIST = resolve(DIR, 'public');
|
||||
const CLIENT_DIST = resolve(DIR, '../public');
|
||||
|
||||
app.use(express.json());
|
||||
app.use('/icons', express.static(resolve(DIR, 'public', 'icons')));
|
||||
app.use('/icons', express.static(resolve(DIR, '../public', 'icons')));
|
||||
app.use((req, res, next) => {
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user