Back to Strapi

Strapi server (WIP)

docs/docs/api/strapi-server.mdx

5.45.11.7 KB
Original Source

import Type from '@site/docs/api/components/type';

Strapi Server

:::info

Current state: Stable

:::

The Strapi server module permits to generate a Strapi http server.

Module: Strapi server

createServer(strapi)

javascript
const server = createServer(strapi);

server.listRoutes();

StrapiServer.app

Strapi projects are using KoaJS to run the NodeJS server.

StrapiServer.router

Strapi projects are using a dependency of KoaJS called @koa/router.

StrapiServer.httpServer

The Strapi's HTTP server.

StrapiServer.api(name)

Getter for apis available in Strapi

StrapiServer.use(...args)

Shortcut for Koa app.use(...args) method.

StrapiServer.routes(routes)

:::info TODO :::

StrapiServer.mount()

:::info TODO :::

StrapiServer.initRouting()

:::info TODO :::

StrapiServer.initMiddlewares()

:::info TODO :::

StrapiServer.listRoutes()

:::info TODO :::

StrapiServer.listen(...args)

:::info TODO :::

StrapiServer.destroy()

:::info TODO :::

StrapiAPIs

Strapi APIs is a map of all APIs available inside the Strapi project.