Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example_chat doesn't work, down't load example_chat.html #240

Closed
bigOconstant opened this issue Oct 6, 2021 · 6 comments · Fixed by #241
Closed

example_chat doesn't work, down't load example_chat.html #240

bigOconstant opened this issue Oct 6, 2021 · 6 comments · Fixed by #241
Labels
bug Something isn't working

Comments

@bigOconstant
Copy link

bigOconstant commented Oct 6, 2021

Attempting to run the example code example_chat results in Template "example_chat.html" not found error.

git clone [email protected]:CrowCpp/Crow.git
mkdir build

cd build

cmake ..

make

./examples/example_chat

Navigate to http://0.0.0.0:40080/

Receive error that it can't find html file

@The-EDev The-EDev added bug Something isn't working and removed bug Something isn't working labels Oct 6, 2021
@The-EDev
Copy link
Member

The-EDev commented Oct 6, 2021

This is because the template location is relative to where your working directory, meaning it's trying to find example_chat.html in /build/ rather than /build/examples/, just navigate to examples and run the application from there.

@The-EDev The-EDev closed this as completed Oct 6, 2021
@bigOconstant
Copy link
Author

This is because the template location is relative to where your working directory, meaning it's trying to find example_chat.html in /build/ rather than /build/examples/, just navigate to examples and run the application from there.

Also tried that. Still doesn't work

@The-EDev The-EDev reopened this Oct 6, 2021
@The-EDev
Copy link
Member

The-EDev commented Oct 6, 2021

This is interesting, I just tested it and it worked on my machine

@bigOconstant
Copy link
Author

I tried using absolute file path and I get the same error.

Im on latest manjaro. What are you running?

@bigOconstant
Copy link
Author

I can make a dockerfile to reproduce it, if I can't reproduce it in docker i'll just use docker

@The-EDev The-EDev added the bug Something isn't working label Oct 6, 2021
@The-EDev
Copy link
Member

The-EDev commented Oct 6, 2021

Alright I figured out the issue, the path has to be relative to the templates directory (relative to the working directory still), there's a problem where example_chat.html is being copied to examples rather than examples/templates/, I'll submit a fix soon, thanks for reporting the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants