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