javascript - Using Express inside Atom Electron -


i have application running express, , trying distribute using electron.

running electron in debug this:

/path/to/electron/electron.app/contents/macos/electron path-to-my-app 

my application runs fine. express fires server , works -- main window opens correctly using mainwindow.loadurl('http://localhost:3000/');

when follow distribution tutorial (linked before) copy application resources to:

/path/to/electron/electron.app/contents/resources/app 

but when run electron.app, see cannot / in main window... have no idea why.

any ideas?

my thought process.cwd() not correctly helping me define document root here:

//configure express default web requests /workspace/ folder expressapp.use(express.static(process.cwd() + '/workspace')); 

but if that's case, don't know how around it.

it turns out express reason didn't document root mapping.

rather using:

//configure express default web requests /workspace/ folder expressapp.use(express.static(process.cwd() + '/workspace')); 

i instead use this:

expressapp.use(express.static(path.join(__dirname, 'workspace'))); 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -