endpoints / endpoints-example

an example api written using endpoints
79 stars 21 forks source link

Make package public. #17

Closed jamesplease closed 9 years ago

jamesplease commented 9 years ago

Doesn't quite close #16, but gets us halfway there. Once this is merged a new release will need to be cut on npm.

@tkellen could you add me as an npm contrib?

ashleygwilliams commented 9 years ago

:+1:

tkellen commented 9 years ago

@jmeas I sure could. I'm confused though--what would consuming this package as a dependency look like?

tkellen commented 9 years ago

Ah, n/m, I just saw your previous issue.

Hrmm. In the very near term this repo will include multiple implementations (one for koa is coming from @Dremora). Could you add this as a git url dependency instead?

ashleygwilliams commented 9 years ago

@tkellen do you think the multiple framework implementations should be in the same repo? i feel pretty strongly against that...

tkellen commented 9 years ago

I generally feel strongly against that, but since we're talking about a bunch of boilerplate that will differ minimally, I worry about having them in separate repos.

tkellen commented 9 years ago

Basically, I want to be able to atomically update all example repos to match whatever the current version of endpoints is with a single commit.

ashleygwilliams commented 9 years ago

the duplication will be a bit of a pain, but i could think of a lot of reasons that it would add value. (i.e. per framework diffs for updating your app with a new version of endpoints, this example here with @jmeas use-case...)

additionally, if this is a learning resource, i don't think we want to clutter the repo..

tkellen commented 9 years ago

Fair point. I just worry about the maintenance burden, but I should probably not worry about that, since I'm not doing this alone. @Dremora, would you mind making endpoints-example-koa using this as a base?

tkellen commented 9 years ago

Before we publish this, we need to make src/index the main file. That means that this repo as a package will export an express router you can mount anywhere. @jmeas feel free to publish this as endpoints-example-express and add me/ashley as an author.

ashleygwilliams commented 9 years ago

@tkellen i promise to help with the maintenance. assign me all the things.

and i like that idea (re: src/index) but i don't think it is strictly necessary, and might actually be confusing for some?

tkellen commented 9 years ago

I think we'd have to do it that way, otherwise requiring the module just fires up an instance of express and that seems weird to me. But, I'm not the one with this use case and I won't be using it as ya'll are describing. As long as we clearly state how this repo works as a package, I'm game for whateva!

jamesplease commented 9 years ago

I think there are situations where separating examples into multiple repos or keeping them in the same repo makes sense. I'd maybe draw the line depending on the size of the project and the complexity of setting up the environment to work on the projects.

For my Orbit examples, for instance, I plan to keep them small and all in the same repo so that you can start up the API once then explore the different (relatively small) examples with more ease than pulling down multiple repos.

In regards to these Endpoints examples I do have a slight preference toward different repos, so :+1: to that.

That means that this repo as a package will export an express router you can mount anywhere.

For my use case, I don't need to mount it on different Express app. In fact, I don't even want to expose any of the complexities behind the API. Because we have CORS configured, I was just going to start up the API on a different port from my other application, and go from there. My preference would be that the main file simply starts up the API.

ashleygwilliams commented 9 years ago

My preference would be that the main file simply starts up the API.

i like this simply because it means that we don't necessarily need to explain express/whatever-framework to people who want to try out endpoints. this also makes it a great example for json-api, again because it doesn't require other knowledge immediately

jamesplease commented 9 years ago

Gonna merge this and cut an npm release in the next day or two.