skip to Main Content

Javascript – How do you import a .json file into a node.js file when the .json file is in an upper directory?

I have this folder structure in my project. testproject/backend/amplify/backend/function/newestjavascript/src/index.js. And testproject/backend/src/amplifyconfiguration.json I want to import amplifyconfiguration.json into my index.js file and use it. I am trying to use the require() statement from node, but it always tells me my amplifyconfiguration.json…

VIEW QUESTION
Back To Top
Search