Skip to content

Commit 093ac27

Browse files
committed
update
1 parent bde82b4 commit 093ac27

File tree

7 files changed

+1364
-23
lines changed

7 files changed

+1364
-23
lines changed

Caddyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:5037
1+
:{$PORT}
22

33
route / {
44
reverse_proxy localhost:4010

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ FROM node:22-alpine
33
ENV NODE_ENV=production
44

55
RUN apk add --no-cache make caddy
6-
RUN npm install -g @stoplight/prism-cli
76

87
COPY package.json package-lock.json* ./
98
RUN npm ci && npm cache clean --force
@@ -12,6 +11,6 @@ COPY . .
1211

1312
RUN make compile
1413

15-
EXPOSE 8080
16-
1714
CMD ["make", "start"]
15+
16+
EXPOSE 8080

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
IMAGE_ID := ghcr.io/hexlet-components/rest-api-example
2-
PORT := 5037
1+
IMAGE_ID := ghcr.io/hexlet-components/http-example
2+
PORT := 8080
33

44
setup:
55
npm ci
@@ -12,14 +12,14 @@ compile:
1212
npx tsp compile ./typespec/js-playwright/main.tsp --output-dir "./tsp-output/js-playwright"
1313

1414
dev:
15-
docker rm -f rest-api-example
16-
docker run -e PORT=$(PORT) -v ./custom-server:/custom-server -p $(PORT):$(PORT) --name rest-api-example $(IMAGE_ID)
15+
docker rm -f http-example
16+
docker run -e PORT=$(PORT) -v ./custom-server:/custom-server -p $(PORT):$(PORT) --name http-example $(IMAGE_ID)
1717

1818
start:
19-
prism mock -m -d --json-schema-faker-fillProperties=false -p 4011 --host 0.0.0.0 ./tsp-output/http-api/@typespec/openapi3/openapi.1.0.yaml &
20-
prism mock -m -d --json-schema-faker-fillProperties=false -p 4012 --host 0.0.0.0 ./tsp-output/http-protocol/@typespec/openapi3/openapi.1.0.yaml &
21-
prism mock -m -d --json-schema-faker-fillProperties=false -p 4013 --host 0.0.0.0 ./tsp-output/js-playwright/@typespec/openapi3/openapi.1.0.yaml &
22-
prism mock -m -d --json-schema-faker-fillProperties=false -p 4014 --host 0.0.0.0 ./tsp-output/postman/@typespec/openapi3/openapi.1.0.yaml &
19+
npx prism mock -m -d --json-schema-faker-fillProperties=false -p 4011 --host 0.0.0.0 ./tsp-output/http-api/@typespec/openapi3/openapi.1.0.yaml &
20+
npx prism mock -m -d --json-schema-faker-fillProperties=false -p 4012 --host 0.0.0.0 ./tsp-output/http-protocol/@typespec/openapi3/openapi.1.0.yaml &
21+
npx prism mock -m -d --json-schema-faker-fillProperties=false -p 4013 --host 0.0.0.0 ./tsp-output/js-playwright/@typespec/openapi3/openapi.1.0.yaml &
22+
npx prism mock -m -d --json-schema-faker-fillProperties=false -p 4014 --host 0.0.0.0 ./tsp-output/postman/@typespec/openapi3/openapi.1.0.yaml &
2323
npm start &
2424
caddy run
2525

@@ -30,8 +30,8 @@ docker-build:
3030
docker build . -t $(IMAGE_ID)
3131

3232
docker-run:
33-
docker rm -f rest-api-example
34-
docker run -e PORT=$(PORT) -p $(PORT):$(PORT) --name rest-api-example $(IMAGE_ID)
33+
docker rm -f http-example
34+
docker run -e PORT=$(PORT) -p $(PORT):$(PORT) --name http-example $(IMAGE_ID)
3535

3636
docker-sh:
3737
docker run -e PORT=$(PORT) -it --entrypoint sh $(IMAGE_ID)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ See [Makefile](./Makefile)
1111

1212
```bash
1313
make docker-build
14-
make docker-run # Open http://localhost:5037
14+
make docker-run # Open http://localhost:8080
1515
```
1616

1717
---

custom-server/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const setupDocs = async (app) => {
2929
specification: {
3030
path: openapiFilePath,
3131
},
32-
// routePrefix: `${name}-${appConfig.docRoute}`,
32+
routePrefix: `${name}-${appConfig.docRoute}`,
3333
});
3434

3535
await instance.register(swaggerUI, {

0 commit comments

Comments
 (0)