Comments (7)
Hi, thank you for taking the time to try this out on cloud9. That is incredible.
The webpack-dev-server endpoints for the static files are only active and used when you are running with webpack-dev-server.
When you are running the server on its own, the server uses the inert plugin and the electrode-static-files decor https://github.com/electrode-io/electrode-static-paths#static-files to serve files at the port you configured in your config files.
from electrode-server.
Hi,
Thank you for your reply and for sharing work with the community !
In fact, I am using the dev mode.
From my cloud9 workspace, in a terminal I run :
gulp dev
And in the log I see :
[11:11:29] Using gulpfile ~/workspace/gulpfile.js
[11:11:29] Starting 'dev'...
[11:11:29] Starting '.webpack-dev'...
[11:11:29] Finished '.webpack-dev' after 145 μs
[11:11:29] Starting 'server-dev'...
[11:11:29] Starting 'server-watch-$deps$'...
[11:11:29] Starting '.init-bundle.valid.log'...
[11:11:29] Finished '.init-bundle.valid.log' after 1.63 ms
[11:11:29] Finished 'server-watch-$deps$' after 4.4 ms
[11:11:29] Starting 'server-watch'...
[11:11:29] Starting 'generate-service-worker'...
[11:11:29] Finished 'generate-service-worker' after 357 μs
[nodemon] 1.10.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: .etmp/bundle.valid.log /home/ubuntu/workspace/server/**/* /home/ubuntu/workspace/config/**/*
Entry point configuration is not found, using default entry point...
isomorphic-loader webpack plugin: removed existing config file
0% compile http://localhost:2992/webpack-dev-server/
webpack result is served from http://localhost:2992/js/
content is served from /home/ubuntu/workspace
webpack bundle is now VALID
webpack report is served from http://localhost:2992/reporter
[nodemon] restarting due to changes...
[nodemon] starting `node server/index.js`
staticPaths Plugin: static files path prefix "dist"
Hapi.js server running at http://<cloud9.workspace.host.name>:8081
This line in particular :
webpack result is served from http://localhost:2992/js/
I would like webpack to server the assets from http://<cloud9.workspace.host.name>:8081/js/
How can I achieve this ?
Thanks
Christophe
from electrode-server.
I see. At the moment the port 2992 can't be changed but I am planning to make a change to that. However, webpack-dev-server would have to listen on a different port than the main server for obvious reasons. Would that work for you?
The port is set here https://github.com/electrode-io/electrode-archetype-react-app/blob/master/config/archtype.js#L16.
Is there a reason you are running with webpack-dev-server like that?
from electrode-server.
It should work, thanks.
I want to use this port because cloud9 only allows ports 8080, 8081 & 8082 to be used.
Cheers,
Christophe
from electrode-server.
electrode-archetype-react-app 1.3.2 supports env WEBPACK_DEV_PORT
, you can set that to the port you want.
from electrode-server.
Thanks jchip.
I had to make additional edits :
in node_modules/electrode-archetype-react-app/config/archetype.js
:
webpack: {
devHostname: "my-workspace.my-cloud9-username.c9users.io", // edit
devPort: getInt(process.env.WEBPACK_DEV_PORT, 2992),
testPort: getInt(process.env.WEBPACK_TEST_PORT, 3001),
modulesDirectories: []
},
It would be good to be able to set an env variable for the hostname aswel.
and in server/plugins/webapp/index.js
:
const pluginOptionsDefaults = {
pageTitle: "Untitled Electrode Web Application",
webpackDev: process.env.WEBPACK_DEV === "true",
renderJS: true,
serverSideRendering: true,
devServer: {
host: "my-workspace.my-cloud9-username.c9users.io", //edit
port: "8082" // edit
},
paths: {},
stats: "dist/server/stats.json"
};
Now webpack serves it at my-workspace.my-cloud9-username.c9users.io:8082 :
Entry point configuration is not found, using default entry point...
isomorphic-loader webpack plugin: removed existing config file
0% compile http://localhost:8082/webpack-dev-server/
webpack result is served from http://my-workspace.my-cloud9-username.c9users.io:8082/js/
content is served from /home/ubuntu/workspace
webpack bundle is now VALID
But the browser fail to get the resource (HTTP 503)
It think that it's on Cloud 9 side as it does not see the app running on port 8082
Cheers
Christophe
from electrode-server.
Close due to inactivity
from electrode-server.
Related Issues (20)
- Warning when runs with custom config HOT 2
- Use namespaced configuration in confippet HOT 2
- Timeout variable HOT 1
- Extending archetypes webpack loaders without forking project? HOT 1
- Console colors HOT 2
- Errors in `createReduxStore` are not logged HOT 2
- How do I configure cookies in electrode server? HOT 2
- "Unknown handler: file" error when tutorial app is launching on Heroku HOT 1
- use bluebird@3?
- Data layer HOT 1
- On sever start it shows HOT 2
- Provide an option to suppress the "Hapi.js server running" startup banner HOT 2
- Are there plans on updating electrode-server to hapi v17? HOT 2
- Register plugins failed from electrode app server HOT 3
- Unable to start hapi server , followed steps from doc as below HOT 2
- Upgrade to hapi v18
- Upgrade electrode-server version HOT 1
- Electrode server register plugins timeout HOT 3
- How to add custom deployment config? HOT 5
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 electrode-server.