pl-jay
pl-jay

Reputation: 1100

Web Directory is visible after React app deployed on cPanel

I have created a simple react app and built the app using npm run build command and uploaded it to host. it works but whole application directory is visible in web browser console. So how do i fix it to not to show web directory on web console. Once the application kept growing and sensible data will visible. So is there any method to avoid that.

Here's the on cPanel File Manager

cPanel File Manager

and js directory has minified js like this,

 js directory content

But once it loads on web browser it shows App.js content,

enter image description here

Any suggestions.

Upvotes: 4

Views: 1137

Answers (1)

SeanMC
SeanMC

Reputation: 2356

After running "npm run build" , publish your "build" folder. Not your "public" folder.

Upvotes: 1

Related Questions