mirror of
https://github.com/strapi/strapi.git
synced 2026-01-04 03:03:38 +00:00
docs(api): add doc for Strapi server
This commit is contained in:
parent
acb2f190b0
commit
2ec478af3c
27
docs/docs/api/api.mdx
Normal file
27
docs/docs/api/api.mdx
Normal file
@ -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
|
||||
@ -34,13 +34,50 @@ server.listRoutes();
|
||||
```
|
||||
|
||||
### `StrapiServer.app`
|
||||
|
||||
[<Type>KoaJS</Type>](https://devdocs.io/koa/index) https://devdocs.io/koa/index
|
||||
|
||||
Strapi projects are using KoaJS to run the NodeJS server.
|
||||
|
||||
### `StrapiServer.router`
|
||||
|
||||
[<Type>@koa/router</Type>](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`
|
||||
|
||||
[<Type>http.Server</Type>](https://nodejs.org/docs/latest-v18.x/api/http.html)
|
||||
|
||||
The Strapi's HTTP server.
|
||||
|
||||
### `StrapiServer.api(name)`
|
||||
|
||||
- `name`: <Type>String</Type>
|
||||
- Returns: [<Type>StrapiAPIs</Type>](#strapiapis)
|
||||
|
||||
Getter for apis available in Strapi
|
||||
|
||||
### `StrapiServer.use(...args)`
|
||||
|
||||
[<Type>KoaApp.use</Type>](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)`
|
||||
### `StrapiServer.listen(...args)`
|
||||
### `StrapiServer.destroy()`
|
||||
|
||||
### `StrapiAPIs`
|
||||
<Type>Object</Type>
|
||||
|
||||
- `content-api`: [<Type>API</Type>](API)
|
||||
- API used by external requesters
|
||||
- `admin`: [<Type>API</Type>](API)
|
||||
- API used by admin panel
|
||||
|
||||
Strapi APIs is a map of all APIs available inside the Strapi project.
|
||||
Loading…
x
Reference in New Issue
Block a user