How to create a custom end point to generate random two items

System Information
  • Strapi Version: 4.0.2:
  • Operating System : Windows 10:
  • Database: PostgressSql:
  • Node Version: >=12.x.x <=16.x.x:
  • NPM Version: >=6.0.0:

I would like to create a custom end point for example (/random-posts) that returns every time it’s called two random posts from my posts collection.

how can I do that? I would like to point out that I’m using GraphQl so if I can just do some work around in the Query that would work too.

I would very much appreciate the help

1 Like

Did you find a solution for the archiving?