Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.1",
"description": "Leaflet Osmand React ExpressJS Coordinates (X)\r > Remember an \"X\" marks the spot.",
"main": "index.js",
"type": "module",
"scripts": {
"clean": "rm -rf dist/*",
"build": "rm -rf dist/* && npx tsc && cp -R httpdocs/ dist/",
Expand Down
11 changes: 4 additions & 7 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import express from 'express';
import { Request, Response } from 'express';
import fs from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
import path from 'path';

const app = express();
const port = 80;
Expand All @@ -16,7 +12,8 @@ app.get('/', (req: Request, res: Response) => {

app.listen(port, () => {
const date = new Date().toLocaleString('de-DE', { hour12: false });
const logPath = join(__dirname, 'httpdocs', 'log.txt');
const logPath = path.join(__dirname, 'httpdocs', 'log.txt');
fs.appendFileSync(logPath, `Express: Server: ${date} \n`);

console.log(`Server läuft unter http://localhost:${port}`);
});
});
12 changes: 6 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "ES2022",
"sourceMap": true
"rootDir": "src",
"outDir": "dist",
"module": "CommonJS",
"moduleResolution": "node",
"target": "ES6",
"sourceMap": true
}
}