mirror of
https://github.com/LemmyNet/joinlemmy-site.git
synced 2025-02-05 08:34:42 +00:00
Adding redoc / tsoa generated API docs.
This commit is contained in:
parent
38ad15408d
commit
12496167dd
4 changed files with 12 additions and 6 deletions
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -13,7 +13,7 @@
|
|||
[submodule "lemmy-js-client"]
|
||||
path = lemmy-js-client
|
||||
url = https://github.com/LemmyNet/lemmy-js-client
|
||||
branch = release/v0.19
|
||||
branch = tsoa_1
|
||||
[submodule "lemmy-stats-crawler"]
|
||||
path = lemmy-stats-crawler
|
||||
url = https://github.com/LemmyNet/lemmy-stats-crawler.git
|
||||
|
|
|
@ -14,7 +14,7 @@ RUN tar -xzf mdbook.tar.gz
|
|||
COPY lemmy-docs ./lemmy-docs
|
||||
RUN ./mdbook build lemmy-docs -d ../docs
|
||||
|
||||
# Build the typedoc API docs
|
||||
# Build the typedoc lemmy-js-client docs, and swagger.json
|
||||
FROM node:20-alpine AS api
|
||||
WORKDIR /app
|
||||
COPY lemmy-js-client lemmy-js-client
|
||||
|
@ -22,6 +22,7 @@ WORKDIR /app/lemmy-js-client
|
|||
RUN corepack enable pnpm
|
||||
RUN pnpm i
|
||||
RUN pnpm run docs
|
||||
RUN pnpm tsoa
|
||||
|
||||
# Build the isomorphic app
|
||||
FROM node:20-alpine AS builder
|
||||
|
@ -48,9 +49,10 @@ COPY joinlemmy-translations joinlemmy-translations
|
|||
COPY lemmy-translations lemmy-translations
|
||||
COPY src src
|
||||
|
||||
# Copy the docs and API
|
||||
# Copy the rust docs, lemmy-js-client docs, and OpenAPI docs.
|
||||
COPY --from=docs /app/docs ./src/assets/docs
|
||||
COPY --from=api /app/lemmy-js-client/docs ./src/assets/api
|
||||
COPY --from=api /app/lemmy-js-client/docs ./src/assets/lemmy-js-client-docs
|
||||
COPY --from=api /app/lemmy-js-client/redoc-static.html ./src/assets/api.html
|
||||
|
||||
RUN pnpm i
|
||||
RUN pnpm prebuild:prod
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 5b3c7ebcfa7bc9598254999b72b9ec89007bd51e
|
||||
Subproject commit 2b7ef3dc1c82ddcebbae3b9247cfd76166a61f80
|
|
@ -26,7 +26,11 @@ server.use(express.json() as RequestHandler);
|
|||
server.use(express.urlencoded({ extended: false }) as RequestHandler);
|
||||
server.use("/static", express.static(path.resolve("./dist")));
|
||||
server.use("/docs", express.static(path.resolve("./dist/assets/docs")));
|
||||
server.use("/api", express.static(path.resolve("./dist/assets/api")));
|
||||
server.use("/api", express.static(path.resolve("./dist/assets/api.html")));
|
||||
server.use(
|
||||
"/lemmy-js-client-docs",
|
||||
express.static(path.resolve("./dist/assets/lemmy-js-client-docs")),
|
||||
);
|
||||
server.use(
|
||||
"/context.json",
|
||||
cors,
|
||||
|
|
Loading…
Reference in a new issue