~denisebitca/lowf

bd8b641afd1b8f59831342a15ff0df6a93bd6230 — Rafael Bitca 2 years ago 8bc7f19
Removed hard-coded paths
3 files changed, 8 insertions(+), 5 deletions(-)

M src/classes/ChatServer.ts
M src/classes/ChatUser.ts
M src/config.json
M src/classes/ChatServer.ts => src/classes/ChatServer.ts +1 -1
@@ 28,7 28,7 @@ export class ChatServer {
        ChatServer.app = express();

        //Setting up Express routes
        ChatServer.app.use('/', express.static(__dirname + '/../public'));
        ChatServer.app.use('/', express.static(config.websiteDir));

        if(debug){
            ChatServer.server = ChatServer.app.listen(port, ()=>{

M src/classes/ChatUser.ts => src/classes/ChatUser.ts +5 -3
@@ 58,9 58,11 @@ export class ChatUser {
                    //command parse
                    if(parsedMsg.body === ChatUser._search){
                        //user has requested to search for other users

                        if(debug) log("debug", "command parse > search request")
                        this.setState(ChatUser.LOOKING);
                        //user must be CONNECTED or DISCONNECTED???
                        if(this.state === ChatUser.CONNECTED || this.state === ChatUser.DISCONNECTED){
                            if(debug) log("debug", "command parse > search request")
                            this.setState(ChatUser.LOOKING);
                        }
                    } else if(parsedMsg.body === ChatUser._disconnect){
                        //user has requested to disconnect
                        //user must be either PAIRED or LOOKING

M src/config.json => src/config.json +2 -1
@@ 3,5 3,6 @@
    "debug": false,
	"websitedomain": "lowf.codes",
    "logDir": "",
    "reportDir": ""
    "reportDir": "",
    "websiteDir": ""
}