Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Parse-Dashboard/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ packageJson('parse-dashboard', 'latest').then(latestPackage => {

module.exports = function(config) {
var app = express();
app.set('views', './');
app.set('view engine', 'jade');

// Serve public files.
app.use(express.static(path.join(__dirname,'public')));

Expand Down Expand Up @@ -83,7 +86,7 @@ module.exports = function(config) {

// For every other request, go to index.html. Let client-side handle the rest.
app.get('/*', function(req, res) {
res.sendFile(__dirname + '/index.html');
res.render('index', { route: config.route });
});

return app;
Expand Down
7 changes: 7 additions & 0 deletions Parse-Dashboard/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
html
head
title Parse Dashboard
body
base(href=route)
#browser_mount
script(src="bundles/dashboard.bundle.js")
8 changes: 6 additions & 2 deletions Parse-Dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ p.then(config => {

const app = express();

app.use(parseDashboard(config.data));
config.data.route = config.data.route || '/';
// add trailing slash
if (config.data.route.substr(-1) != '/') config.data.route += '/';

app.use(config.data.route, parseDashboard(config.data));
// Start the server.
app.listen(port);

console.log(`The dashboard is now available at http://localhost:${port}/`);
console.log(`The dashboard is now available at http://localhost:${port}${config.data.route}`);
}, error => {
if (error instanceof SyntaxError) {
console.log('Your config file contains invalid JSON. Exiting.');
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"basic-auth": "^1.0.3",
"commander": "^2.9.0",
"express": "^4.13.4",
"jade": "^1.11.0",
"json-file-plus": "^3.2.0",
"package-json": "^2.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/Icon/Icon.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let Icon = ({ name, fill, width, height }) => {
}
return (
<svg {...props} >
<use xlinkHref={`/bundles/sprites.svg#${name}`} />
<use xlinkHref={`bundles/sprites.svg#${name}`} />
</svg>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Dashboard extends React.Component {
}

componentDidMount() {
get('/parse-dashboard-config.json').then(({ apps, newFeaturesInLatestVersion = [] }) => {
get('parse-dashboard-config.json').then(({ apps, newFeaturesInLatestVersion = [] }) => {
this.setState({ newFeaturesInLatestVersion });
let appInfoPromises = apps.map(app => {
if (app.serverURL.startsWith('https://api.parse.com/1')) {
Expand Down
2 changes: 1 addition & 1 deletion webpack/base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
context: path.join(__dirname, '../src'),
output: {
filename: '[name].bundle.js',
publicPath: '/bundles/'
publicPath: 'bundles/'
},
resolve: {
root: [__dirname,path.join(__dirname, '../src'), path.join(__dirname, 'node_modules')]
Expand Down