Follow these steps to update Codapi to a specific version.
- Backup the current version:
cd /opt/codapi
mv codapi codapi.bak
- Download and install the new version (replace
0.x.x
with an actual version number):
cd /opt/codapi
export version="0.x.x"
curl -L -o codapi.tar.gz "https://github.com/nalgeon/codapi/releases/download/${version}/codapi_${version}_linux_amd64.tar.gz"
tar xvzf codapi.tar.gz
chmod +x codapi
rm -f codapi.tar.gz
- Restart Codapi:
sudo systemctl restart codapi.service
- Verify that Codapi is working:
curl -H "content-type: application/json" -d '{ "sandbox": "ash", "command": "run", "files": {"": "echo hello" }}' http://localhost:1313/v1/exec