WriteFreely Archive Page Generator

Hello everyone! At the request of a WriteFreely user, I created an alternate version of the Write.as Archive Page Generator app that can work with other WriteFreely instances. I have it up and running on here. However I’m running into what looks like a CORS related issue when using it to build an archive page for a WriteFreely blog. I’ve listed the errors below.

This is the error I get when I test on my local:
Access to fetch at 'https://write.tedomum.net/api/collections/rgx/posts?page=1' from origin 'https://localhost:44320' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

This is the error I get on the live site:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://write.tedomum.net/api/collections/rgx/posts?page=1. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Now I want to point out that the app works just fine when I pass in Write.as as the instance name. It only fails when I pass in another WriteFreely instance name, like say write.tedomum.net. It also works just fine with a WriteFreely instance, when I try to build an archive page via a console application. That tells me that there must be some CORS related setting on the non-Write.as instances that prevents the app from working. Would anyone know what that setting is?

1 Like

Thank you so much for working on this, Dino, much appreciated.

I found your ‘Archive’ listing of posts super useful, and hope we could have that for users in the write.freely instances as well.

I will contact our admins at TeDomum.net and request some assistance, it’s possible we need them to enable cross site access permission for API use.

Cheers! :slightly_smiling_face::+1:

1 Like