1

I have a problem registering a service that's on the filesystem already. I know I managed to do it before but I've lost the skill.

I have tried this:

curl
  -H "Content-Type: application/json"
  -X POST
  -d @install-data.json 
  http://localhost:8529/_api/foxx

install-data.json

{
    "configuration": {
        "engines": {
            "arangodb": "^3.0.0"
        },
        "main": "index.js"
    },
    "source": "/var/opt/foxx/getting-started.zip"
}

The service bundle is located at /var/opt/foxx/getting-started.zip

The result is

{"error":true,"errorNum":3013,"errorMessage":"failed to parse service options\nDetails: Unexpected token o in JSON at position 1","code":400}

1 Answer 1

1

There is currently a bug in the HTTP API when parsing configuration and dependencies in the request body. Github issue here. Your given parameters in configuration should also exists in your service manifest.json so there is no need to set them in your request. For you it should work if you only post

{
  "source": "/var/opt/foxx/getting-started.zip"
}
Sign up to request clarification or add additional context in comments.

2 Comments

You're a star! Is it possible to point source to a folder as well? I'm using docker and the files are mounted already.
The docs says only zip but the code says folder works too :-) I tested it and it works with folders for me. I will change this in the docs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.