Please refer to building a HTTP API using request handlers and processors for more information.
Validate environment, should be minimum 4G:
Refer to Docker memory for details and troubleshooting:
$ docker info | grep "Total Memory" or $ podman info | grep "memTotal"
Check-out, compile and run:
$ git clone --depth 1 https://github.com/vespa-engine/sample-apps.git $ cd sample-apps/examples/http-api-using-request-handlers-and-processors && mvn clean package $ docker run --detach --name vespa --hostname vespa-container \ --publish 127.0.0.1:8080:8080 --publish 127.0.0.1:19071:19071 \ vespaengine/vespa
Wait for the configserver to start:
$ curl -s --head http://localhost:19071/ApplicationStatus
Deploy the application:
$ curl --header Content-Type:application/zip --data-binary @target/application.zip \ localhost:19071/application/v2/tenant/default/prepareandactivate
Wait for the application to start:
$ curl -s --head http://localhost:8080/ApplicationStatus
Test the application:
$ curl -s 'http://localhost:8080/demo?terms=1%202%203%204'
Shutdown and remove the container:
$ docker rm -f vespa