express-admin | MySQL , MariaDB , PostgreSQL , SQLite admin for Node.js | Database library
kandi X-RAY | express-admin Summary
kandi X-RAY | express-admin Summary
MySQL, MariaDB, PostgreSQL, SQLite admin for Node.js
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- get datepicker list
- edit row
express-admin Key Features
express-admin Examples and Code Snippets
Community Discussions
Trending Discussions on express-admin
QUESTION
My project is an NPM module that is used by an ExpressJS server. The server needs to specify an endpoint and my module will do the rest. How do I get my module to load the correct html page and grab the correct js/css files from the correct path?
The ProblemI'm running into a problem where I can see the directory structure of the site, using the serveIndex library, and all the files are in their correct directories but for some reason when I try to load any of the files, whether from the serveIndex
view or from the actual endpoint where it should load, I get nothing but 404 errors.
Here's an example if someone wanted to use this NPM module from their project.
app.js (their server) ...ANSWER
Answered 2019-Jan-29 at 14:59I'll be answering my own question.
The solution is actually pretty simple. The view layer of this module is handled by React, CRA to be specific. CRA will look for some specific environment variables, one of them being PUBLIC_URL
. All I had to do was
- Create a
.env
file in the root directory of my CRA - add
PUBLIC_URL="/admin"
Afterward, it's just rebuilding the project, yarn build
, and reset the server. CRA will then look at http://localhost:3000/admin/static/...
instead of http://localhost:3000/static/...
for static assets.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install express-admin
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page