Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't get currect static files when embedding express-admin #123

Open
beilunyang opened this issue Apr 1, 2017 · 2 comments
Open

can't get currect static files when embedding express-admin #123

beilunyang opened this issue Apr 1, 2017 · 2 comments

Comments

@beilunyang
Copy link

I can't get current static files when embedding express-admin to my express app.
this is my config.json and app.js

// config.json
"app": {
        "root": "."
 }
// app.js
const express = require('express');
const bodyParser = require('body-parser');
const xAdmin = require('express-admin');
const xAdminConfig = require('./express-admin-config/config');
const xAdminSettings = require('./express-admin-config/settings');
const xAdminCustom = require('./express-admin-config/custom');
const xAdminUsers = require('./express-admin-config/users');
const api = require('./routes/api');

const config = {
  dpath: './express-admin-config/',
  config: xAdminConfig,
  settings: xAdminSettings,
  custom: xAdminCustom,
  users: xAdminUsers,
};

xAdmin.init(config, (err, admin) => {
  if (err) return console.error(err);
  const app = express();
  app.use('/admin', admin);
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(bodyParser.json());
  app.use('/api/v1', api);
  return app.listen(3000, () => console.log('server is listening:3000'));
});

i can get currect static files when i access to mainview , but when i access to editview and newview, i can't get currect static files.



the content of .js file and .css file is html code...
hope you can understand what i mean, thank you...

@ThomasVictoria
Copy link

+1

@priya2429
Copy link

I'm experiencing the same, Did you manage to solve it some way, If so, please share with us, So it will be helpful for many. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants