A system that emulates a subset of the HTTP API provided by Piattaforma Notifiche platform, driven by well-defined use cases, and produces a report describing their coverage and correctness.
If you have to verify your integration, check out the documentation that describes the steps to run and use the PnValidator
.
-
Start the
PnValidator
as described in the How to run section. -
Configure your integration as follows:
- Set the
x-api-key
tokey-value
, - Point your base URL to the
PnValidator
(it depends on how you started it, e.g.:http://localhost:3000
).
- Set the
-
Test your integration.
-
Call the
/checklistresult
endpoint that reports the use cases coverage and status. If all the checks areok
then your integration covers the expected use cases.
# this is an example, the port and the hostname depend on how you started the PnValidator system
curl --location --request GET 'http://localhost:3000/checklistresult'
We provide a couple of different ways to start the PnValidator
:
- from the source code
- as a Docker image
This section describes how to start the PnValidator
from the source code.
Since this project runs with Node.js as specified in the .node_version
file, we strongly encourage using nvm.
Here is what you need to do:
- Clone the repository using the preferred method (the next command uses SSH):
git clone git@github.com:pagopa/pn-local-emulator.git
- (Optional but strongly recommended) Install the Node.js runtime using
nvm
(please, make sure the path of.node_version
is correct. The given commands assume you are in the repository folder.).
# Install the version of Node.js specified in the .node_version file
nvm install `cat .node-version`
# Set the version of Node.js specified in the .node_version file
nvm use `cat .node-version`
- Install the dependencies.
npm install
- Generate code from the OpenAPI specification.
npm run generate
- Start the
PnValidator
.
npm run start
Another option is to run the PnValidator
with Docker.
These are the steps:
- Download the latest image version of the tool from the registry.
docker pull ghcr.io/pagopa/pn-local-emulator:latest
- Start the container.
docker run -p 3000:3000 ghcr.io/pagopa/pn-local-emulator:latest
Hint: The Docker image exposes the port 3000 of the container, so you can use the -p option to map it to a port of your choice.
The repository comes with a Dockerfile that you can use to run the PnValidator
with Docker.
- Build the image.
docker build -t pnemulator .
- Run the
PnValidator
.
docker run -p 3000:3000 pnemulator
Hint: The Dockerfile exposes the port
3000
of the container, so you can use the-p
option to map it to a port of your choice.
When you upload a document, the max allowed size of that document is 100MB.