Adding service to runtime

We can now provide the Api service to RuntimeServer.

The Api service is server-only. It can't be used on the client. Therefore, we provide it only to RuntimeServer.

We simply need to add Api.Live inside MainLayer of RuntimeServer:

src/services/RuntimeServer.ts
import { Layer, ManagedRuntime } from "effect";
import { Api } from "./Api";

const MainLayer = Layer.mergeAll(Api.Live);

export const RuntimeServer = ManagedRuntime.make(MainLayer);

MainLayer merges all the layers available in the runtime using Layer.mergeAll (only Api.Live for now).

With this we can use RuntimeServer to execute effects that depend on Api.

RuntimeServer has type ManagedRuntime<Api>, where Api is the service included in the runtime.