My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How to setup and deploy admin panel for any site?

Aniketh Saha's photo
Aniketh Saha
·Feb 16, 2019

I have ecommerce site which is having an admin panel. Both are having node.js server and simple html css for frontend The admin panel is already created. what I did is I add the admin site inside of the main site project as an seperate node project. I did this so that they can share a common public folder to upload the images and other things. is it fine?

       ..
15-02-2019  22:00                25 .gitignore
05-12-2018  22:45               345 .snyk
15-02-2019  22:31    <DIR>          Admin_Site  
06-12-2018  00:00    <DIR>          configs
15-02-2019  20:52               647 ecosystem.config.js
02-02-2019  17:04             1,945 editing_Guide.txt
06-12-2018  00:00    <DIR>          logs
15-02-2019  19:54    <DIR>          node_modules
15-02-2019  19:54           289,709 package-lock.json
15-02-2019  19:54             1,212 package.json
06-12-2018  00:00    <DIR>          public
02-02-2019  17:00             5,101 server.js
06-12-2018  00:00    <DIR>          src
05-12-2018  22:45             8,222 todo.txt

The Admin_Site folder is having the full admin panel project Now they are running in different ports therefore if I deploy the whole as an project then I can have the admin_Site running in seperate port to access it . Therefore if I host it as a different project then I how can I use the shared public folder so that it can access the images. UPDATED :

I am asking is it the optimal way to host admin panel? and 2nd question is I cant use different port if this admin_site project is inside the main site . So if I host it in different domain then how can I upload the images in the main site's public folder. I am using multer for uploading Image