Skip to content

ConnectMongoHttp

Source: src/Railway/ConnectMongoHttp.ts Kind: Layer · Provides: Railway.ConnectMongo

Implementation of ConnectMongo. Provide it on the Service Effect.

At deploy time this packs the private connection URI onto the host (RAILWAY_MONGO_*, MONGO_URL). At runtime the client reads process.env.

Effect.gen(function* () {
const conn = yield* Railway.ConnectMongo(Db);
const url = yield* conn.connectionString;
}).pipe(Effect.provide(Railway.ConnectMongoHttp))