Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Changing default URL path #12

Open
gagan-bansal opened this issue Sep 25, 2017 · 0 comments
Open

Changing default URL path #12

gagan-bansal opened this issue Sep 25, 2017 · 0 comments

Comments

@gagan-bansal
Copy link

Hi,

Right now server is running on http;//localhost:3000/ I want to run it like http;//localhost:3000/chatbot

So I need to change following:
in components/wxpress_webserver.js

// existing
webserver.use(express.static('public'));
// changed to 
webserver.use('/chatbot', express.static('public'));

In public/index.js

// existing
<script src="client.js"></script>
// changed to
<script src="chatbot/client.js"></script>

In public/client.js

// existing
 ws_url: 'ws://my-host-ip:3000', 
// changed to 
 ws_url: 'ws://my-host-ip:3000/chatbot', 

But its not working, basic thing I found that http;//localhost:3000/chatbot/index.html and http;//localhost:3000/chatbot/client.js itself are not accessible

To my surprise http;//localhost:3000/client.js is accessible.

Then I commented in components/wxpress_webserver.js

// changed to 
// webserver.use('/chatbot', express.static('public'));

And restarted the server node bot.js
Still http;//localhost:3000/client.js is accessible, so how this is happening I am not able to understand.

Any clarification? and how can I achieve desired result i.e. http;//localhost:3000/chatbot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants