async ({ data, deep, require }) => {
//your code
}
/healthz
- GET - 200 - Health check endpoint- Response:
{}
- Response:
/init
- GET - 200 - Initialization endpoint- Response:
{}
- Response:
/call
- GET - 200 - Call executable code of handler in this isolation provider- Request:
- body:
- params:
- jwt: STRING - Deeplinks send this token, for create gql and deep client
- code: STRING - Code of handler
- data: {} - Data for handler execution from deeplinks
If this is type handler
- oldLink - from deeplinks, link before transaction
- newLink - from deeplinks, link after transaction
- promiseId - from deeplinks, promise id
- params:
- body:
- Response:
{ resolved?: any; rejected?: any; }
- If resolved or rejected is not null, then it's result of execution
- Request:
deep
- Deep Client instancedata
- Data for handler execution from deeplinks
async ({ data, deep, require }) => {
return data;
}
async ({ data, deep, require }) => {
return await deep.select(1);
}
async ({ data, deep, require }) => {
return await deep.insert({
"type_id": 58,
"from_id": 0,
"to_id": 0
});
}
async ({deep, data}: {
deep: DeepClient;
data: {
newLink: Link<number>;
};
}) => {
return await deep.insert({
"type_id": 58,
"from_id": 0,
"to_id": 0
});
}
async ({deep, data}: {
deep: DeepClient;
data: {
newLink: Link<number>;
};
}) => {
return 5
}
async() => {
const myNumber: number = 5;
return myNumber
}
npm install
npm ci
docker build -t bun-js-docker-isolation-provider .
docker run -d -p 39100:39100 -e PORT=39100 bun-js-docker-isolation-provider
npx bun build --target=bun ../index.ts --outfile=/index.js
npx bun build --compile /index.ts --outfile=/
npx bun build --minify --splitting --outdir=out ./index.ts