Skip to content

Dev Server

The freestyle dev server serves multiple purposes. It’s first purpose is to watch for changes in your code and automatically extract the classes from your code into a single file. This file is used by the freestyle runtime to store data and provide an RPC layer to your classes.

The second purpose of the dev server is to simulate the freestyle cloud’s execution environment locally. It runs a web server at http://localhost:8910 and where it will serve cloudstate at http://localhost:9810/cloudstate and proxy all other requests to your project’s underlying dev server. By default, the dev server will proxy requests to http://localhost:4321 and will attempt to run the server by running npm run dev in your project’s root directory. You can change this behavior in freestyle.config.ts.

export default defineConfig({
dev: {
proxy: "http://localhost:4321",
command: "npm run dev",
},
});