How to connect to a Routerlicious local server?

Viewed 299

I have followed this guide https://github.com/microsoft/FluidFramework/tree/main/server/routerlicious and I have set up successfully a Routerlicious server and the gateway https://github.com/microsoft/FluidFramework/tree/main/server/gateway, but I am having trouble connecting the client to it. Here is the client code config:

...
    const hostUrl = "http://localhost:3000";
    const ordererUrl = "http://localhost:3000";
    const storageUrl = "http://localhost:3000";
    const tenantId = "unused";
    const tenantKey = "unused";
    
    const serviceRouter = new RouterliciousService({
        orderer: ordererUrl,
        storage: storageUrl,
        tenantId: tenantId,
        key: tenantKey,
      });
    const container = await getContainer(
       serviceRouter,
       documented,
       ContainerFactory,
       createNew
     );
...

The error is giving me is : Buffer is not defined

I guess it is because of the tenantId and tenantKey. How can I solve this?

1 Answers

It sounds like you already got Routerlicious started, if so, jump to the last header. To recap...

Routerlicious

  1. Cloning the Fluid Framework repository,
  2. Installing and starting Docker
  3. Running npm run start:docker from the Fluid Framework repo root.

Routerlicious is our name for the reference Fluid service implementation.

To get Routerlicious started, npm run start:docker uses the pre-built docker containers on Docker Hub. These are prepackaged for you in a docker-compose file in the repository.

Gateway

Gateway is a reference implementation of a Fluid Framework host. Gateway let's you run Fluid containers on a website. More specifically, it's a docker container that runs a web service. That web service delivers web pages with a Fluid Loader on it.

While that's a good option for running any Fluid container on one site, it is probably easier to use your strategy. That is... create your own website that connects directly to the service and loads your Fluid container.

Connecting to Routerlicious

To connect to your local Routerlicious instance, you need to know the orderer url, storage url, tenant id, and tenant key. By default, we provide a test local key in the config. The test tenant id is "local" and the test key is "43cfc3fbf04a97c0921fd23ff10f9e4b".

Related