Skip to content

Commit

Permalink
Update developer docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-lee committed Apr 18, 2024
1 parent dc31ee1 commit 43f0517
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ $ cd cspace-ui.js
$ npm install
```

To run the application in development at http://localhost:8080, using a remote back-end CollectionSpace server:

```
$ npm run devserver --back-end=https://core.dev.collectionspace.org
```

See the [developer documentation](https://github.com/collectionspace/cspace-ui.js/tree/master/docs/developer) for instructions on building, testing, and running the source code.

## About CollectionSpace
Expand Down
7 changes: 5 additions & 2 deletions docs/developer/BuildScripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ npm run devserver [--back-end=<url> [--local-index=<path>]]

The `devserver` script starts a local development web server, listening at port 8080. The cspace-ui application may be accessed in a browser by opening the URL http://localhost:8080. As source code files are edited, changes are automatically detected and deployed into the dev server. The browser automatically reloads the page, so the latest changes are always visible.

If the `back-end` option is supplied, the dev server acts as a proxy to the specified URL. This allows the locally running UI to connect to a remote CollectionSpace server regardless of CORS settings on that server. When the index.html file is retrieved from the server, the proxy attempts to rewrite it to inject the local UI that is under development. If this fails, or other changes are needed to the index.html file retrieved from the server, a local index file can be substituted by supplying the `local-index` option, specifying a path to a local HTML file.
If the `--back-end` option is supplied, the dev server acts as a proxy to the specified URL. This allows the locally running UI to connect to a remote CollectionSpace server regardless of CORS settings on that server. When the index.html file is retrieved from the server, the proxy attempts to rewrite it to inject the local UI that is under development. If this fails, or other changes are needed to the index.html file retrieved from the server, a local index file can be substituted by supplying the `local-index` option, specifying a path to a local HTML file.

If the `back-end` option is not supplied, the page served by the dev server is the top-level [index.html](../../index.html) file.
> [!WARNING]
> SAML single sign-on will not work when using the `--back-end` option. If SSO is required while developing the UI, run the development server without `--back-end`, as described below.
If the `--back-end` option is not supplied, the page served by the dev server is the top-level [index.html](../../index.html) file. The URL of the CollectionSpace server to use can be set by specifying the `serverUrl` configuration property in index.html. Note that the CORS settings on that server must allow the origin `http://localhost:8080`.

To stop the dev server, type control-c in the shell in which it was started.

Expand Down

0 comments on commit 43f0517

Please sign in to comment.