1
0
forked from noxious/server

Code improvements

This commit is contained in:
2024-06-23 01:53:06 +02:00
parent f5191aa81f
commit 08b6c5c598
4 changed files with 26 additions and 25 deletions

View File

@ -1,6 +1,7 @@
import { Server } from "socket.io";
import {TSocket} from "../../utilities/Types";
import fs from 'fs';
import path from "path";
interface IPayload {
}
@ -14,8 +15,7 @@ export default function (socket: TSocket, io: Server) {
socket.on('gm:tile:list', async (data: any, callback: (response: string[]) => void) => {
// get root path
const root_folder = process.cwd();
const folder = `${root_folder}/public/tiles`;
const folder = path.join(process.cwd(), 'public', 'tiles');
// list the files in the folder
let tiles: string[] = [];