Running the Y-Sweet server locally
If you are using Y-Sweet on Jamsocket, it is generally recommended that you use the Y-Sweet server Jamsocket runs for you even when developing. If you do this, it’s a good idea to create a Y-Sweet service just for your development workflow so you keep documents created in development separate from your production documents.
If you are not using Y-Sweet on Jamsocket or if you would prefer to develop entirely offline, you can run the Y-Sweet server locally with:
npx y-sweet serve
That command will output a connection string that you can use for development. When running locally, the connection string will look something like: ys://127.0.0.1:8080
.
Writing Y-Sweet data to local disk
By default, y-sweet serve
does not write data to local disk. You can specify a directory to persist data to, like this:
npx y-sweet@latest serve /path/to/data
If the directory starts with s3://
, Y-Sweet will treat it as an S3-compatible bucket path. In this case, Y-Sweet will pick up your local AWS credentials from the environment. If you do not have AWS credentials set up, you can set them up with aws configure
.