Skip to content

Commit 0eaef8e

Browse files
committed
fix: improve and refactor index.js
1 parent da58906 commit 0eaef8e

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
"branches": ["main", "master"]
2828
},
2929
"files": [
30-
"dist",
31-
"types",
30+
"dist",
3231
"public",
3332
"README.md"
3433
],

public/assets/js/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import Mustache from 'https://cdn.jsdelivr.net/npm/mustache@4.2.0/+esm';
2+
13
// Function to retrieve the list of maps from the API
24
async function getMapsList() {
35
try {
@@ -103,7 +105,6 @@ const CARD_TEMPLATE = `
103105
// Load maps from API and render map cards with Mustache
104106
async function loadTMJ() {
105107
try {
106-
const Mustache = (await import('https://cdn.jsdelivr.net/npm/mustache@4.2.0/+esm')).default;
107108
const maps = await getMapsList();
108109

109110
const mapImages = maps

src/controllers/FrontController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import express from 'express';
22
import * as fs from "node:fs";
33
import * as path from "node:path";
44
import Mustache from 'mustache';
5-
import { getCoreRoot } from '../getCoreRoot.js';
5+
import { getCoreRoot } from '../utils/getCoreRoot.ts';
66

77
export class FrontController {
88
private app: express.Application;

src/server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import express from 'express';
22
import * as path from "node:path";
33
import * as fs from "node:fs";
44
import cors from 'cors';
5-
import { getCoreRoot } from './getCoreRoot.js';
6-
import { FrontController } from './controllers/FrontController.js';
7-
import { MapController } from './controllers/MapController.js';
8-
import { UploaderController } from './controllers/UploaderController.js';
5+
import { getCoreRoot } from './utils/getCoreRoot.ts';
6+
import { FrontController } from './controllers/FrontController.ts';
7+
import { MapController } from './controllers/MapController.ts';
8+
import { UploaderController } from './controllers/UploaderController.ts';
99

1010
const app = express();
1111

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"DOM"
1010
],
1111
"allowJs": true,
12+
"allowImportingTsExtensions": true,
1213
"moduleResolution": "Node",
1314
"strict": true,
1415
"noImplicitAny": true,

0 commit comments

Comments
 (0)