diff --git a/pages/index.js b/pages/index.js index d1bff46..468bf51 100644 --- a/pages/index.js +++ b/pages/index.js @@ -160,9 +160,8 @@ export default function Home({ profiles, filesData }) { export async function getServerSideProps() { // const profiles = await listReactFiles(__dirname + 'data/'); // console.log(__dirname); - const directoryPath = - process.env.NODE_ENV === 'production' ? '/shared/data' : '/shared/data'; + const directoryPath = path.join(process.cwd(), './public/data'); const fileNames = [], filesData = []; const files = fs.readdirSync(directoryPath); @@ -177,7 +176,7 @@ export async function getServerSideProps() { return { props: { - fileNames, + // fileNames, filesData, profiles: 'profiles' } diff --git a/shared/data/rakeshpotnuru.json b/public/data/rakeshpotnuru.json similarity index 100% rename from shared/data/rakeshpotnuru.json rename to public/data/rakeshpotnuru.json diff --git a/shared/data/ramansharma.json b/public/data/ramansharma.json similarity index 100% rename from shared/data/ramansharma.json rename to public/data/ramansharma.json