From 2ec478af3c2d49917ae8256291e50837038fe87f Mon Sep 17 00:00:00 2001 From: nathan-pichon Date: Tue, 14 Feb 2023 18:18:25 +0100 Subject: [PATCH] docs(api): add doc for Strapi server --- docs/docs/api/api.mdx | 27 +++++++++++++++++++++++ docs/docs/api/strapi-server.mdx | 39 ++++++++++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 docs/docs/api/api.mdx diff --git a/docs/docs/api/api.mdx b/docs/docs/api/api.mdx new file mode 100644 index 0000000000..278e37892e --- /dev/null +++ b/docs/docs/api/api.mdx @@ -0,0 +1,27 @@ +--- +title: API +slug: /api/API +tags: +- module +- public + +toc_min_heading_level: 2 +toc_max_heading_level: 3 +--- +import Type from '@site/docs/api/components/Type'; + +# API + +:::info + +Current state: **Stable** + +::: + +The Strapi API module permits to generate a Strapi API object that wrap all the functionalities around Strapi endpoints + +## Module: API + +### `createAPI(strapi, opts)` + +// TODO \ No newline at end of file diff --git a/docs/docs/api/strapi-server.mdx b/docs/docs/api/strapi-server.mdx index 8c123cd902..f79b4be202 100644 --- a/docs/docs/api/strapi-server.mdx +++ b/docs/docs/api/strapi-server.mdx @@ -34,13 +34,50 @@ server.listRoutes(); ``` ### `StrapiServer.app` + +[KoaJS](https://devdocs.io/koa/index) https://devdocs.io/koa/index + +Strapi projects are using KoaJS to run the NodeJS server. + ### `StrapiServer.router` + +[@koa/router](https://github.com/ZijianHe/koa-router#router-) https://github.com/ZijianHe/koa-router#router- + +Strapi projects are using a dependency of KoaJS called @koa/router. + ### `StrapiServer.httpServer` + +[http.Server](https://nodejs.org/docs/latest-v18.x/api/http.html) + +The Strapi's HTTP server. + ### `StrapiServer.api(name)` + +- `name`: String +- Returns: [StrapiAPIs](#strapiapis) + +Getter for apis available in Strapi + ### `StrapiServer.use(...args)` + +[KoaApp.use](https://devdocs.io/koa/index#appusefunction) https://devdocs.io/koa/index#appusefunction + +Shortcut for Koa `app.use(...args)` method. + ### `StrapiServer.routes(routes)` ### `StrapiServer.mount()` ### `StrapiServer.initRouting()` ### `StrapiServer.initMiddlewares()` ### `StrapiServer.listRoutes()` -### `StrapiServer.listen(...args)` \ No newline at end of file +### `StrapiServer.listen(...args)` +### `StrapiServer.destroy()` + +### `StrapiAPIs` +Object + +- `content-api`: [API](API) + - API used by external requesters +- `admin`: [API](API) + - API used by admin panel + +Strapi APIs is a map of all APIs available inside the Strapi project. \ No newline at end of file