Skip to content

Commit

Permalink
Merge pull request #156 from nulib/deploy/staging
Browse files Browse the repository at this point in the history
Deploy to production
  • Loading branch information
adamjarling authored Jul 6, 2023
2 parents c8c9c47 + c140406 commit 9e8f85d
Show file tree
Hide file tree
Showing 10 changed files with 307 additions and 254 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ The API will be available at:
- `http://USER_PREFIX.dev.library.northwestern.edu:3000` (from elsewhere)
- Don't forget to [open port 3000](https://github.com/nulib/aws-developer-environment#convenience-scripts) if you want to access it remotely

⚠️ Note the above URLs (which point to your local OpenSearch instance) need _full endpoints_ to resolve. For example:

- `http://USER_PREFIX.dev.library.northwestern.edu:3000/search`
- `http://USER_PREFIX.dev.library.northwestern.edu:3000/collections`

[View supported endpoints](https://api.dc.library.northwestern.edu/docs/v2/spec/openapi.html) Questions? [View the production API documention](https://api.dc.library.northwestern.edu/)

## Running the API locally via our AWS dev domain

Use the [https-proxy](https://github.com/nulib/aws-developer-environment#convenience-scripts) script to make the local environment live at: https://[DEV_PREFIX].dev.rdc.library.northwestern.edu:3002/search
Expand All @@ -69,6 +76,45 @@ Use the [https-proxy](https://github.com/nulib/aws-developer-environment#conveni
https-proxy start 3002 3000
```

## Example workflows

### Meadow

View and edit information about a specific Work in the Index.

1. Open a local Meadow instance.
2. Find an `id` of a Work you'd like to inspect in the API.
3. View JSON response at `http://USER_PREFIX.dev.library.northwestern.edu:3000/works/[WORK_ID]`
4. View IIIF Manifest JSON response at `http://USER_PREFIX.dev.library.northwestern.edu:3000/works/[WORK_ID]?as=iiif`

For help debugging/inspecting, JavaScript `console` messages are written to: `dc-api-v2/dc-api.log`

### DC

Develop against changes to the API.

1. Before starting the DC app, temporarily change the port number in `dc-nextjs/server.js` from default `3000` to something like `3003`.
2. Open the port so it can be accessed in the browser.

```
sg open all 3003
```

3. Start the proxy for the API

```
https-proxy start 3002 3000
```

4. Point to the proxy URL and start DC app (in your `/environment/dc-nextjs` shell)

```
export NEXT_PUBLIC_DCAPI_ENDPOINT=https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002
npm run dev
```

Access the app in a browser at: https://USER_PREFIX.dev.rdc.library.northwestern.edu:3003/

## Deploying the API manually

- Symlink the `*.parameters` file you need from `tfvars/dc-api/` to the application root
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dc-api-build",
"version": "2.1.0",
"version": "2.1.1",
"description": "NUL Digital Collections API Build Environment",
"repository": "https://github.com/nulib/dc-api-v2",
"author": "nulib",
Expand Down Expand Up @@ -51,4 +51,4 @@
]
}
}
}
}
4 changes: 4 additions & 0 deletions src/api/response/iiif/presentation-api/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ function metadataLabelFields(source) {
label: "Language",
value: source.language.map((item) => item.label),
},
{
label: "License",
value: formatSingleValuedField(source.license?.label),
},
{
label: "Location",
value: source.location?.map((item) => item.label),
Expand Down
4 changes: 2 additions & 2 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dc-api",
"version": "2.1.0",
"version": "2.1.1",
"description": "NUL Digital Collections API",
"repository": "https://github.com/nulib/dc-api-v2",
"author": "nulib",
Expand Down
Loading

0 comments on commit 9e8f85d

Please sign in to comment.