Skip to content

Commit

Permalink
added viewer process diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
codetricity committed May 31, 2024
1 parent 1b35f53 commit 7c14b32
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Binary file added docs/images/structure/browser_process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 22 additions & 4 deletions docs/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,31 @@ for the UI that you embed the viewer in.


This example uses [Express](https://expressjs.com/) for the server.
Let's say you create a route, `/content`. The front-end application
goes to `http://localhost:3000/content` and then Express will run
Let's say you create two routes, `/viewer` and `/content`. The
first route to `/viewer` loads the React app that then
loads the RICOH Viewer. The React app will also load content with
a HTTP GET request to `/content`.

In the code example `views/viewer.ejs`, this snippet goes to the
`/content` route.

```typescript
const res = await fetch("/content", {
method: "GET",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
});
```

When the app calls `/content`, Express will run
a method that you created. In this example, the method is called
`getContent()`.

![browser process](images/structure/browser_process.png)

Prior to actually getting the content, you must first generate a token.
The method `getContent()` will first generate a token, then it will
The function `getContent()` will first generate a token, then it will
get the content from the RICOH360 Content API. The token is put into
the Authorization header.

Expand Down Expand Up @@ -370,4 +388,4 @@ viewer.start({
```
- Viewer is Ricoh embedded viewer API
- Viewer is initialized by specific a divId to inject the viewer UI into, an onFetchToken function for authorization and a CubeMapEnabled
- Viewer is started with a contentID (call fetchContent() function to get contentIDs) and a transform value ie. "enhancement" or "undefined"
- Viewer is started with a contentID (call `fetchContent()` function to get contentIDs) and a transform value ie. "enhancement" or "undefined"

0 comments on commit 7c14b32

Please sign in to comment.