Skip to content
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

Proposal: Interface to configure the Express server #337

Closed
taras opened this issue Jan 26, 2014 · 7 comments
Closed

Proposal: Interface to configure the Express server #337

taras opened this issue Jan 26, 2014 · 7 comments

Comments

@taras
Copy link

taras commented Jan 26, 2014

ember-app-kit project recently moved from Karma to Testem. With Karma, we used their built in proxy to connect to api stub and proxy functionality that was backed by an Express server.

With Testem, this implementation can be simpler and more flexible because Tested uses Express.js to serve the content. We would like to be able to hook into the Testem's Express server configuration.

This will allow us to configure to add custom api stub routes or proxy requests to external API.

Re #218: An interface to configure the express server can serve a relief valve for people who need to implement functionality that you wouldn't want to encourage otherwise.

Are you open to a PR that will allow this functionality?

@airportyh
Copy link
Collaborator

Good timing as I am currently brainstorming how to make the web server and
other things pluggable. I think I might use connect-style middleware as the
interface for pluggable services. I might choose to move away from
express. People have asked for proxying in the past and I have mixed
feelings about that. Do you have a proposal?

On Sunday, January 26, 2014, Taras Mankovski notifications@github.com
wrote:

ember-app-kit https://github.com/stefanpenner/ember-app-kit project
recently moved from Karma to Testem. With Karma, we used their built in
proxy to connect to api stub and proxy functionality that was backed by an
Express server.

With Testem, this implementation can be simpler and more flexible because
Tested uses Express.js to serve the content. We would like to be able to
hook into the Testem's Express server configuration.

This will allow us to configure to add custom api stub routes or proxy
requests to external API.

Re #218 #218: An interface to
configure the express server can serve a relief valve for people who need
to implement functionality that you wouldn't want to encourage otherwise.

Are you open to a PR that will allow this functionality?


Reply to this email directly or view it on GitHubhttps://github.com//issues/337
.

@taras
Copy link
Author

taras commented Jan 26, 2014

Implementing proxy with Express is trivial and defining Express routes is easy and familiar to many developers. I like the idea of using Express for these reasons.

For me to be able to add proxy and custom routes I just need access to the app(Express) instance. I'm not sure what is the best way of getting to that object.

What are your thoughts up to this point?

@airportyh
Copy link
Collaborator

I think a connect (http://www.senchalabs.org/connect/) or connect-like
middleware is what we need for both simple proxying and routing. Routing
will be slightly more low-level than what you are used to w express, but
not too bad.

On Sunday, January 26, 2014, Taras Mankovski notifications@github.com
wrote:

Implementing proxy with Express is trivial and defining Express routes is
easy and familiar to many developers. I like the idea of using Express for
these reasons.

For me to be able to add proxy and custom routes I just need access to the
app(Express) instance. I'm not sure what is the best way of getting to that
object.

What are your thoughts up to this point?


Reply to this email directly or view it on GitHubhttps://github.com//issues/337#issuecomment-33327625
.

@taras
Copy link
Author

taras commented Jan 26, 2014

It sounds like it will work just as well.

How can I help?

@airportyh
Copy link
Collaborator

It might take me some time to re-architech this. If you want this soon, I
suggest that you just fork testem for the time being - quick and dirty.
When the time comes, I'd appreciate help with testing the plugin system.

On Sunday, January 26, 2014, Taras Mankovski notifications@github.com
wrote:

It sounds like it will work just as well.

How can I help?


Reply to this email directly or view it on GitHubhttps://github.com//issues/337#issuecomment-33330913
.

@taras
Copy link
Author

taras commented Jan 28, 2014

I'll happy to test whenever the plugin interface is built. I might even be able to write some examples of how to use the proxy.

@airportyh, any idea when you'd be able to work on this?

@piuccio
Copy link

piuccio commented Feb 3, 2014

Oh great, this would be an ever better solution for #333 .
There are many reasons why one would add connect-style middlewares, and coverage is one of them.

You can be sure that I'll help testing the plugin system 😉

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

3 participants