Hello everyone
Is there any difference between importing data staticaly like: import data from "../public/data" and putting data inside app dir and load like example here: https://vercel.com/guides/loading-static-file-nextjs-api-route
#Difference between static import data and load from app dir
14 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
The difference is anything inside the public folder is publicly viewable meaning your data is not secured and will be visble to the user if they go to <your-domain>/<data>.json .
thank you for your answer @ocean tide this approach does not make it server sidedata right? i want to make my data server side is it possible or it is default server side data?
yes, store it anywhere inside src folder.
It'll only be accessible in the server
@desert grove thank you so much ❤️
Mark this message as a solution.
Right Click > Apps > Mark Solution
✅ Success!
This question has been marked as answered! If you have any other questions, feel free to create another post
Jump to answer
[Click here](#1271508749974245398 message)
ty
@desert grove is there a difference between static import then if i put my data inside src?
If you put data inside src, you can import like import json from "@/path/to/file.json"
If your issue is resolved, mark the above message as a sol
✅ Success!
This question has been marked as answered! If you have any other questions, feel free to create another post
Jump to answer
[Click here](#1271508749974245398 message)