Comments (3)
Here is an example configuration for NginX that I'm using:
location / {
# your Express Admin server
proxy_pass http://localhost:3000;
}
# Static Files:
# express-admin
location ~ /express-admin\.(css|js) {
root /path/to/node_modules/express-admin/public;
try_files $uri $uri;
}
# custom - in case you have any custom views
location ~ /custom\.(css|js) {
root /path/to/your/custom/views/static/files;
try_files $uri $uri;
}
# express-admin-static
root /path/to/node_modules/express-admin-static;
location ^~ /jslib/ {
try_files $uri $uri;
}
location ^~ /csslib/ {
try_files $uri $uri;
}
location ^~ /font/ {
try_files /csslib/fonts/$uri =404;
}
location ^~ /bootswatch/ {
try_files $uri $uri;
}
from express-admin.
Thanks @simov!
It appears that the script to change bootstrap themes is responsible for this. I'm using this workaround so that the default theme won't trigger the FOUC (views/js/theme.html):
<script type="text/javascript">
var xAdmin = {root: '{{root}}'};
(function () {
var theme = localStorage.getItem('theme') || 'default';
if (theme == 'default')
return;
var bootstrap = document.getElementById('bootstrap');
bootstrap.href = xAdmin.root+'/bootswatch/'+theme+'/bootstrap.min.css';
}());
</script>
This only prevents the FOUC for the default theme, but may help someone else. :)
from express-admin.
What I have seen improving this situation is putting Express Admin behind NginX for example. In that setup you let NginX serve all of the static assets and Node.js to serve the Express Admin routes only.
from express-admin.
Related Issues (20)
- nsp security issues HOT 1
- Store comma seperated values for a single column.
- Passing parameters to /add in order to prevalue fields
- mysql insert operation not working in -v (development, no login) mode HOT 1
- Time is not shown correctlly for mysql db HOT 1
- Unhandled exception when paginating empty resultsets
- Ajax call not working
- Error creating entry with many to many relationship
- crashes under Firefox Quantum 62.0 (64-bit) under OSX
- Support for postgres data type json? HOT 4
- ERROR! Could not find `pg` or `pg.js` module HOT 1
- Can this be used with hapijs? HOT 1
- PG setup via connection string
- Datepicker saving timezone with timestamp HOT 1
- Empty one to Many HOT 4
- Filter in tables throw internal server error HOT 1
- Password authentication fails for Postgres (11) connections HOT 4
- how to configure server using nodemon HOT 1
- what is mean for this error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from express-admin.