aws-lex-web-ui
aws-lex-web-ui copied to clipboard
Must deploy to the root?
It looks like I have to deploy this code to a website at its root. Can we clean up the relative paths to make it deployable to a subdirectory?
The UI tries to get resource files from the root as in: /./lex-web-ui.min.css
Hi Russell,
What file do you see that reference? In the dist folder, index.html references look like this:
<link href="lex-web-ui-loader.min.css" rel="stylesheet">
<link rel="stylesheet" href="./custom-chatbot-style.css">
Chris
Another installation approach is to deploy using the prebuilt cloudformation template and embed the snippet of html available as output from the stack. This approach brings the bot up in an iframe separate from the the hosting page. This is perhaps the easiest mechanism to deploy and keep the UI updated over time with updates.
Can you share how you've setup loading the bot? The following link will take you to some of the general approaches. https://github.com/aws-samples/aws-lex-web-ui#stand-alone-page
Hi Russell,
What file do you see that reference? In the dist folder, index.html references look like this:
<link href="lex-web-ui-loader.min.css" rel="stylesheet"> <link rel="stylesheet" href="./custom-chatbot-style.css">
Chris
Chris, I saw that from the error that the file was not loaded. It was in javascript
HI @russell-oit, yes this is the issue. If we put bot in the subdirectory, it will not work.
www -----HTML - ROOT -----index.html -------------------bot-src -------------------bot-files ( cofig, loader, css, etc)
with this setup, I am unable to load IFrame. It is keep on throwing error for invalid references of css files
@bobpskier hey please help, if you want I can show you my internal s3 bucket structure as well. I am hosting it as s3 bucket static website. I am able to load it with different origins setup, but that approach takes too long to load the bot, and we need to maintain some speed for optimization engine counts, we want to host bot flles within the same setup. But we don't want to spoil our root directory structure. Is there anything I can do to solve it ?
@AbhishekDesai99 I believe the loaderOpts supports that ability to specify a baseUrl. See https://github.com/aws-samples/aws-lex-web-ui/blob/master/src/README.md#loader-constructor-options. This might allow you to specify a path relative to root to find the bot files.