Lorion
Lorion

Reputation: 310

Adding strapi to an express server

I want to build a self-hosted website with nodejs and the express framework because I'm already familar with that. However, using a CMS for this project is a requirement, so I'm looking for a suited and easy-to-use/-learn CMS and discovered strapi which I quite like.

Setting up an API with strapi is easy indeed but now I'm struggling with adding strapi to an express server. My goal is one express server with strapi, which also hosts the website. So, I can control the routing with express (which I'm used to) and can render the site on the server.

Can somebody explain me how to do that and maybe give a small example? The examples I found, are only about hosting the API externally and using a client-side web framework or a static site generator. Or is my vision not possible with strapi and I should use another CMS like KeystoneJS (which is already built on Express)?

Thanks in advance!

Upvotes: 13

Views: 7269

Answers (1)

Pierre
Pierre

Reputation: 1096

Using Express with Strapi must be very complex and does not really make sense. Strapi is based on Koa, which has been designed by the team behind Express. If you are coming from Express, eyou will get confortable with Koa very quickly. Here is the documentation: https://koajs.com.

Upvotes: 2

Related Questions