Giter VIP home page Giter VIP logo

Comments (15)

ericelliott avatar ericelliott commented on August 24, 2024

Would you like to file a pull request? =)

I don't think we need to specifically mention Cloud9. The environment variables should be enough to allow users to make it work on Cloud9.

from react-pure-component-starter.

pdavidow avatar pdavidow commented on August 24, 2024

Perhaps another approach is a flag on npm start.
Environment Variables are only for Windows (I think), but what if someone wants to run Cloud9 say from a Chromebook? Plus, even on Windows, someone may have an account both on Cloud9 and Nitrous etc.

from react-pure-component-starter.

ericelliott avatar ericelliott commented on August 24, 2024

Environment variables work great on any platform, but the way you set them varies depending on platform. However, we should not care about how it gets set, and only respect the environment variables if they are set.

So, for example, you could create host and port variables like this:

const {
  host = 'localhost',
  port = 3000
} = process.env;

Now in your cloud9 console, you can set the environment variable before launching the service:

set HOST='0.0.0.0'
set PORT=8080
npm start

from react-pure-component-starter.

pdavidow avatar pdavidow commented on August 24, 2024

There doesn't seem to be anything to test, so don't know how to write test for this.

Also, since this codebase is written in ES5, new code I would think should conform with something like:

var host = process.env.HOST;
var port = process.env.PORT;

host = host ? host : 'localhost';
port = port ? port : 3000;

from react-pure-component-starter.

pdavidow avatar pdavidow commented on August 24, 2024

I am stuck on manual testing: Unable to set HOST in bash shell.

from react-pure-component-starter.

ericelliott avatar ericelliott commented on August 24, 2024
  1. This codebase is written in ES6.
  2. If HOST is reserved, I'm happy using something less generic like PC_HOST and PC_PORT

from react-pure-component-starter.

pdavidow avatar pdavidow commented on August 24, 2024

When I try to send Pull Request, I get Authentication Failed.

from react-pure-component-starter.

ericelliott avatar ericelliott commented on August 24, 2024

@pdavidow Have you set up your GitHub SSH Keys?

from react-pure-component-starter.

pdavidow avatar pdavidow commented on August 24, 2024

The SSH keys are all set, but it still doesn't help.
Instead, I have pushed branch here: https://github.com/pdavidow/react-pure-component-starter

(Tested manually on Cloud9, and Mac OSX)

from react-pure-component-starter.

ericelliott avatar ericelliott commented on August 24, 2024

If you delete that and just hit the fork button on this repo, then pull your fork and merge your changes into that, then push your changes to your fork, you should be able to submit a pull request. You should see a yellow button pop up asking if you want to submit a PR.

from react-pure-component-starter.

ericelliott avatar ericelliott commented on August 24, 2024

See Forking a repo

from react-pure-component-starter.

pdavidow avatar pdavidow commented on August 24, 2024

The deed has been done, I think. A yellow button (actually, a yellow ring) did pop up, but all it's doing is notifying me of pending CI tests -- it's not asking me to submit a PR. (Anyway, the reason it didn't originally work is because I had cloned without making a fork.)

from react-pure-component-starter.

ericelliott avatar ericelliott commented on August 24, 2024

Nice.. I'll look over it asap

from react-pure-component-starter.

pdavidow avatar pdavidow commented on August 24, 2024

How would you write tests for this?

from react-pure-component-starter.

ericelliott avatar ericelliott commented on August 24, 2024

Set the environment variable. Launch the server. Use something like supertest to make sure the server responds appropriately to requests on the specified host/port.

from react-pure-component-starter.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.