I'm working on a portfolio template that uses a local JSON file that has an object with the name, links and email address, to load data and manipulate the DOM accordingly.
The issue I have is that, it only runs on the server and not on the client side. I'm using the Fetch API and I discovered that it does not allow loading of JSON locally without a server for security reasons. I know I can use Node to run a server, pass the data to client side JS and manipulate the DOM. But the problem is that I want the eventual site to be static and the changes to be persistent, which they are not.
Is there a way to run the server script to simply pass the JSON to client side and then shut it down and have the changes stay permanent? Or am I using the wrong tool to do this?
Top comments (3)
It does sound like you're making things more complicated for yourself than they need to be. Have you looked into static site generators? Gatsby seems to be the popular choice right now.
Its more of a utility package sort of thing that I'm trying to make.. now I'm thinking of making something to render the entire page rather than just the parts..
Hey Please contact SS Job Support for Javascript and NodeJS training and Job Support. They will provide free demo and affordable packages.