Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 3fee240

Browse files
committed
fix: export serve function, set env var
1 parent 549a876 commit 3fee240

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ docker-serve:
4646
--volume /var/run/docker.sock:/var/run/docker.sock \
4747
--volume $$PWD/nixroot:/nixroot:ro \
4848
--publish 3000:3000 \
49+
--env JWT_SECRET=notasecret \
4950
stencila/nixster nixster serve --address 0.0.0.0
5051

5152
# Interact with the container in a Bash shell. Useful for debugging build errors

docker-compose.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ services:
1313
command: nixster serve --address 0.0.0.0
1414
ports:
1515
- "3000:3000"
16-
# Tell the Docker client how to connect to the Docker daemon
17-
# in the sibling container
1816
environment:
17+
# Tell the Docker client how to connect to the Docker daemon
18+
# in the sibling container
1919
DOCKER_HOST: tcp://docker-in-docker:2375
20+
# Set the JWT secret needed for server security
21+
JWT_SECRET: notasecret
2022
# Server needs read access to `/nix` to resolve the location for an
2123
# environment (i.e. resolve the symlink from a `/nix/profiles` to `/nix/store/*-user-environment`)
2224
# so that `PATH` etc can be set properly.

src/serve.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ app.use((error: Error, req: express.Request, res: express.Response, next: any) =
349349
* @param port Port to listen on
350350
* @param address Address to listen on
351351
*/
352-
export default function serve (port: number = 3000, address: string = '') {
352+
export function serve (port: number = 3000, address: string = '') {
353353
app.listen(port, address)
354354
return { port, address }
355355
}

0 commit comments

Comments
 (0)