0

I deployed a simple Twilio chat API to my Github account. After hosting the live chat with Twilio on my Github page. I can see the log-in page but after clicking the Login button it doesn't bring me to the chat room page.

It works fine on my local machine but has an issue on Github. Can someone help me with this issue?

my chat website: https://uraden.github.io/chat-app/

> import React from "react";
import { BrowserRouter, Switch, Route } from "react-router-dom";
import WelcomeScreen from "./WelcomeScreen";
import ChatScreen from "./ChatScreen";

function Router() {
  return (
    <BrowserRouter>
      <Switch>
        <Route exact path="/chat" component={ChatScreen} />
        <Route path="/" component={WelcomeScreen} />
      </Switch>
    </BrowserRouter>
  );
}

export default Router;

1 Answer 1

1

Twilio developer evangelist here.

A Twilio Chat application needs a back-end server to generate Twilio Access Tokens that authenticate your users with the Twilio chat service. GitHub pages does not have a back-end and only hosts static sites. Without an access token, users won't be able to use the chat service.

So, you will either need to deploy the entire application to somewhere else, or host a back-end somewhere else that your GitHub hosted front-end can make requests to.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.