13

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!

Lorion
  • 310
  • 2
  • 10

1 Answers1

2

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.

Pierre
  • 986
  • 8
  • 13
  • 3
    Ok I've already looked a bit into Koa. But where would I define the routes and my own server scripts for the website. Because I only see some routing files for the REST API? In fact, I don't need the REST API as there's only this one server for the cms + the website and I would like to render the site serverside. (Sorry for these "newby" questions , it's the first time I'm using a cms and I'm a bit unsure if strapi is even the right one for me. I thought a headless cms would be the best because I was assuming that this would allow me to use the tools I already know with it (like express)... – Lorion Aug 23 '18 at 15:49