Node JS Help
Tanmay Naik

Tanmay Naik @blazephoenix

About: Dev/Designer/Entrepreneur. Follow me on Twitter - twitter.com/blazephoenix2

Location:
Mumbai, India
Joined:
Jul 21, 2018

Node JS Help

Publish Date: Sep 9 '19
9 3

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?

Comments 3 total

  • Dian Fay
    Dian FaySep 9, 2019

    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.

    • Tanmay Naik
      Tanmay NaikSep 9, 2019

      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..

  • Yexaa Consultancy Services
    Yexaa Consultancy ServicesSep 14, 2019

    Hey Please contact SS Job Support for Javascript and NodeJS training and Job Support. They will provide free demo and affordable packages.

Add comment