Skip to content

how to run a simple production server #1146

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

Closed
awb99 opened this issue Oct 15, 2017 · 1 comment
Closed

how to run a simple production server #1146

awb99 opened this issue Oct 15, 2017 · 1 comment

Comments

@awb99
Copy link

awb99 commented Oct 15, 2017

  • Operating System: debian
  • Node Version:8.7
  • NPM Version:5.4.2
  • webpack Version: 1.15.0
  • webpack-dev-server Version:1.16.5

I dont understand a feature:
I read all the docs, and cannot find how I could server the bundle.js file once I have built the bundle for production. I tried this but it does not work:

var fs = require('fs'),
    path = require('path'),
    express = require('express'); 

var app = express();
app.use(express.static('public')); 

// http
var http = require('http');
var httpServer = http.createServer(app);
var port = 9090;
httpServer.listen(port);
console.log('cititrip priccing  starting http-port: ' + port );

It loads the index.html, but then I dont know how it gets the react router to work.

I am somehow forced to do this, because there is an issue in serving bigger bundles via the webpack-dev-server. #1044

@shellscape
Copy link
Contributor

@awb99 thanks for checking in. unfortunately this isn't the right forum for support questions. citing the issue template:

Please ask questions on StackOverflow or the
webpack Gitter (https://gitter.im/webpack/webpack). General questions, how-to
questions, and support requests will be closed.

Please give one or both of those options a try. It's also super uncool to remove portions of an issue template, and makes the baby seals cry. Templates are always there to help both yourself and the dev teams working on a project.

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

2 participants