Creating a Web Endpoint
Deploying and invoking web endpoints
Serve
beta9 serve
functions like an Ngrok server that live-reloads as you work. Beta9 monitors changes in your local file system and forwards the remote container logs to your local shell.
Serve is great for prototyping. You can develop in a containerized cloud environment in real-time, with adjustable CPU, memory, GPU resources.
It’s also great for testing an app before deploying it. Served functions are orchestrated identically to deployments, which means you can test your Beta9 workflow end-to-end before deploying.
To start an ephemeral serve
session, you’ll use the serve
command:
By default, Beta9 will sync all the files in your working directory to the
remote container. This allows you to use the files you have locally while
developing. If you want to prevent some files from getting uploaded, you can
create a .beamignore
.
Deploying the API
To deploy the app, enter your shell and run this command from the working directory:
After running this command, you’ll see some logs in the console that show the progress of your deployment.
Calling the API
After deploying the API, you’ll be able to copy a cURL request to hit the API. In your app dashboard, click Call API.
Example Request
Example Response
Was this page helpful?