Skip to content

Commit a88ac3d

Browse files
author
James (ODSC)
authored
Merge pull request #532 from simon-20/additions_to_README
Small additions and fixes to README
2 parents ed13eb8 + e5f06d9 commit a88ac3d

File tree

1 file changed

+59
-11
lines changed

1 file changed

+59
-11
lines changed

README.md

+59-11
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,65 @@ See OpenAPI specification `postman/schemas/index.yaml`. To view locally in Swagg
1111
- nvm - [nvm](https://github.com/nvm-sh/nvm) - Node version manager
1212
- Node LTS
1313
- once you've installed nvm run `nvm use` which will look at `.nvmrc` for the node version, if it's not installed then it will prompt you to install it with `nvm install <version>`
14-
- [Azure Functions Core Tools v3](https://github.com/Azure/azure-functions-core-tools)
14+
- [Azure Functions Core Tools v4](https://github.com/Azure/azure-functions-core-tools)
1515
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) version 2.4 or later.
1616
- [Docker Engine](https://docs.docker.com/engine/install/#server)
1717
- [Docker Compose](https://docs.docker.com/compose/install/)
18+
- `xmllint`
19+
- There are two ways to run this locally: directly, or using the `docker compose` setup. The docker build includes the `xmllint` tool. If you run it directly, you may need to install this tool.
20+
- On Ubuntu it is in `libxml2-utils`, so you'll need something like `sudo apt install libxml2-utils`.
1821

1922
## Getting Started
2023

2124
1. Clone this repository
2225
1. Follow instructions for nvm/node prerequisties above
23-
1. Run `npm i` to install dependencies
26+
1. Setup the environment variables using the `.env` file (instructions below)
27+
* If running directly (option 1), this will mean setting up a `redis` database.
28+
29+
### Option 1: running directly
30+
31+
4. Run `npm i` to install dependencies
2432
1. Run `npm start` to run the Function locally using the Azure Functions Core Tools
25-
1. Run `npm run docker:start` to run the Function inside a Docker container using docker-compose.yml to create a Redis instance.
33+
1. The API end points will be available on `localhost:7071`
34+
35+
### Option 2: using docker
36+
37+
4. Run `npm run docker:start` to run the Function inside a Docker container using docker-compose.yml to create a Redis instance.
38+
1. The API end points will be available on `localhost:8080`
39+
40+
41+
### Test setup
42+
43+
To test the basic setup, you can run the following command:
44+
45+
`curl http://localhost:8080/api/pub/version`
46+
47+
This should return a version number (change port if running directly instead of via docker).
48+
49+
To test the validation is working, obtain an IATI XML file, and run the following command (this is if running via the docker setup; change port to `7071` if running directly):
50+
51+
`curl -X POST -d @PATH_TO_IATI_XML http://localhost:8080/api/pub/validate`
52+
53+
You should see something like (if the file is a valid IATI file):
54+
55+
{
56+
"valid": true,
57+
"fileType": "iati-activities",
58+
"iatiVersion": "2.03",
59+
"rulesetCommitSha": "2cd1a14f6c584000ae6d76e708c73ddcc12b6c40",
60+
"codelistCommitSha": "cf571799b909eb894c071dc364cd2a4dfbcd5d7c",
61+
"orgIdPrefixFileName": "org-id-fa56731af7.json",
62+
"apiVersion": "2.3.2",
63+
"summary": {
64+
"critical": 0,
65+
"error": 0,
66+
"warning": 0
67+
},
68+
"errors": []
69+
}
70+
71+
If it has warnings or errors, you'll see them listed.
72+
2673

2774
## Environment Variables
2875

@@ -38,22 +85,22 @@ APPLICATIONINSIGHTS_CONNECTION_STRING
3885

3986
BASIC_GITHUB_TOKEN
4087

41-
- GitHub PAT token to authenticate to the GitHub API to pull in some external resources from GitHub
88+
- GitHub personal access token. This is needed to pull in the Codelists from the `IATI/IATI-Validator-Codelists` repository. Note that you cannot use a "Personal Access Token (Classic)"; you must generate a fine-grained access token.
4289

43-
REDIS_CACHE_SEC=60
44-
REDIS_PORT=6379
45-
REDIS_KEY=
90+
REDIS_CACHE_SEC=60
91+
REDIS_PORT=6379
92+
REDIS_KEY=
4693
REDIS_HOSTNAME=
4794

4895
- Redis connection, leaving the default will connect to a locally installed instance if you have one.
4996

50-
VALIDATOR_SERVICES_URL=https://dev-func-validator-services.azurewebsites.net/api
51-
VALIDATOR_SERVICES_KEY_NAME=x-functions-key
97+
VALIDATOR_SERVICES_URL=https://func-validator-services-dev.azurewebsites.net/api
98+
VALIDATOR_SERVICES_KEY_NAME=x-functions-key
5299
VALIDATOR_SERVICES_KEY_VALUE=
53100

54101
- URL and API Key for Validator Services, used to get list of Publisher Identifiers
55102

56-
### config defaults
103+
### App config defaults (set in `config/config.js`)
57104

58105
```
59106
`APP_NAME`: IATI Validator API
@@ -192,4 +239,5 @@ These are sourced from the following locations:
192239
Due to a [known limitation](https://gitlab.gnome.org/GNOME/libxml2/-/issues/361) in the core library `libxml2` used to perform schema validation, if an activity has a schema error at a line greater than 65535, the value will not be accurate in the context.
193240

194241
If this is the case for your validation report, a message like so will be displayed in the context of the schema error:
195-
`At line greater than: 65537. Note: The validator cannot display accurate line numbers for schema errors located at a line greater than 65537 for this activity.`
242+
243+
At line greater than: 65537. Note: The validator cannot display accurate line numbers for schema errors located at a line greater than 65537 for this activity.

0 commit comments

Comments
 (0)