Skip to content

Commit 9e8f85d

Browse files
authored
Merge pull request #156 from nulib/deploy/staging
Deploy to production
2 parents c8c9c47 + c140406 commit 9e8f85d

File tree

10 files changed

+307
-254
lines changed

10 files changed

+307
-254
lines changed

README.md

+46
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ The API will be available at:
6161
- `http://USER_PREFIX.dev.library.northwestern.edu:3000` (from elsewhere)
6262
- Don't forget to [open port 3000](https://github.com/nulib/aws-developer-environment#convenience-scripts) if you want to access it remotely
6363

64+
⚠️ Note the above URLs (which point to your local OpenSearch instance) need _full endpoints_ to resolve. For example:
65+
66+
- `http://USER_PREFIX.dev.library.northwestern.edu:3000/search`
67+
- `http://USER_PREFIX.dev.library.northwestern.edu:3000/collections`
68+
69+
[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/)
70+
6471
## Running the API locally via our AWS dev domain
6572

6673
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
@@ -69,6 +76,45 @@ Use the [https-proxy](https://github.com/nulib/aws-developer-environment#conveni
6976
https-proxy start 3002 3000
7077
```
7178

79+
## Example workflows
80+
81+
### Meadow
82+
83+
View and edit information about a specific Work in the Index.
84+
85+
1. Open a local Meadow instance.
86+
2. Find an `id` of a Work you'd like to inspect in the API.
87+
3. View JSON response at `http://USER_PREFIX.dev.library.northwestern.edu:3000/works/[WORK_ID]`
88+
4. View IIIF Manifest JSON response at `http://USER_PREFIX.dev.library.northwestern.edu:3000/works/[WORK_ID]?as=iiif`
89+
90+
For help debugging/inspecting, JavaScript `console` messages are written to: `dc-api-v2/dc-api.log`
91+
92+
### DC
93+
94+
Develop against changes to the API.
95+
96+
1. Before starting the DC app, temporarily change the port number in `dc-nextjs/server.js` from default `3000` to something like `3003`.
97+
2. Open the port so it can be accessed in the browser.
98+
99+
```
100+
sg open all 3003
101+
```
102+
103+
3. Start the proxy for the API
104+
105+
```
106+
https-proxy start 3002 3000
107+
```
108+
109+
4. Point to the proxy URL and start DC app (in your `/environment/dc-nextjs` shell)
110+
111+
```
112+
export NEXT_PUBLIC_DCAPI_ENDPOINT=https://USER_PREFIX.dev.rdc.library.northwestern.edu:3002
113+
npm run dev
114+
```
115+
116+
Access the app in a browser at: https://USER_PREFIX.dev.rdc.library.northwestern.edu:3003/
117+
72118
## Deploying the API manually
73119

74120
- Symlink the `*.parameters` file you need from `tfvars/dc-api/` to the application root

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dc-api-build",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "NUL Digital Collections API Build Environment",
55
"repository": "https://github.com/nulib/dc-api-v2",
66
"author": "nulib",
@@ -51,4 +51,4 @@
5151
]
5252
}
5353
}
54-
}
54+
}

src/api/response/iiif/presentation-api/metadata.js

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ function metadataLabelFields(source) {
5353
label: "Language",
5454
value: source.language.map((item) => item.label),
5555
},
56+
{
57+
label: "License",
58+
value: formatSingleValuedField(source.license?.label),
59+
},
5660
{
5761
label: "Location",
5862
value: source.location?.map((item) => item.label),

src/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dc-api",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "NUL Digital Collections API",
55
"repository": "https://github.com/nulib/dc-api-v2",
66
"author": "nulib",

0 commit comments

Comments
 (0)