This is the default project was bootstrapped using hellow world example from Temporal.io
** WARNING **
.env file is commited in this repository for testing porpuse, never commit and push sensitive data.
- Have docker and docker compose installed
- Have nodejs v18 installed.
- Clone the repository
- Go to folder cd NodeJS-Temporal-Workflow
- Run the command docker compose up, this will install and configure temporal cluster.
Note: If you want to debug or continue developing, run docker compose with the file docker-compose-dev.yaml then run the api and worker.
- API:
npm run dev
- Worker:
npm run start
- Env: uncomment the line : #TEMPORAL_CONNECTION_URL=localhost:7233
- You can import postman collection and postman enviroment from postman folder.
http://localhost:6000/sign-message
Request:
{
"message": "This is a test message",
"referenceId": "abc11122abc"
}
Response:
{
"message": "Message signing in progress",
"referenceId": "abc11122abc"
}
http://localhost:6000/sign-message/abc11122abc
Response:
{
"message": "Message signed successfully",
"workflowStatus": "COMPLETED",
"referenceId": "abc11122abc",
"signedMessage": "X9FIzz4NaoGLeXcTwmoPi01GwSD+JxJPnwtY/YXkBLYzffN55zx1JIm9OWnyXbopruVc5P5HaXfrB2SfCdq06BN8suIvn7ajaMXqz6/9PO67w1J+ahPZ1sgJPvGyyc+X6mrMluK0HdTcwwkBSZAqi4ZCTxEwtCJ2oSK7onrGKNxJEjXToIXzbcmRyuNODVReF0eMku5yc8y9podPZ6buMP2XQhYnPmeOwQDqO38zEv96ff5R1MWDJKt42riuN3HsWQKZQ6JA34LelLQRuJ7OeExpMRz6aNILQ/14nTVkXCfLZ8Qw5m866+T3ktFveCKGrieTPPeVg6Us7Cj9n6ls1Q=="
}
The Workflow should return the signed message