forked from noxious/server
Code improvements
This commit is contained in:
@ -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[] = [];
|
||||
|
Reference in New Issue
Block a user