Comments (15)
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.
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.
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.
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.
I am stuck on manual testing: Unable to set HOST in bash shell.
from react-pure-component-starter.
- This codebase is written in ES6.
- If
HOST
is reserved, I'm happy using something less generic likePC_HOST
andPC_PORT
from react-pure-component-starter.
When I try to send Pull Request, I get Authentication Failed.
from react-pure-component-starter.
@pdavidow Have you set up your GitHub SSH Keys?
from react-pure-component-starter.
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.
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.
See Forking a repo
from react-pure-component-starter.
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.
Nice.. I'll look over it asap
from react-pure-component-starter.
How would you write tests for this?
from react-pure-component-starter.
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)
- Simulating onClick when testing HOT 4
- Compatible with Redux Async pattern? HOT 3
- CircleCI build fail HOT 2
- Question HOT 3
- Latest ESLint changed rule names
- Hot reloading HOT 6
- Windows is not supported HOT 4
- Dependency injection: just the React instance? HOT 1
- Webpack error "Unexpected token" HOT 8
- typeError after running `npm t` or `npm run watch`
- React instance injection ? HOT 5
- using enzyme and cherrio HOT 2
- Update babel
- Testing nested components HOT 6
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 react-pure-component-starter.