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

vhost/rewrite support? #3

Open
max-mapper opened this issue Sep 28, 2010 · 6 comments
Open

vhost/rewrite support? #3

max-mapper opened this issue Sep 28, 2010 · 6 comments

Comments

@max-mapper
Copy link

there doesn't seem to be a way to include rewrites through soca yet. is this correct?

@quirkey
Copy link
Owner

quirkey commented Sep 29, 2010

Yes, not yet. Rewrites should be easy though since they're part of the DB - vhost's might be a little harder, but im willing to give it a shot.

@max-mapper
Copy link
Author

ok awesome, I wasn't sure if I was missing something

for reference: python couchapp just has a root level rewrite.json that turns into the array of rewrites on your design doc.

for vhosts you would require server admin credentials and use the _config api.... but that's easy enough to do manually that you wouldn't necessarily need tooling for it (unless you consider a more automated vhost config a big convenience win)

@max-mapper
Copy link
Author

i got deeper into rewrites over the last few days...

http://github.com/maxogden/couchappspora/blob/master/rewrites.json

the rewrites at the bottom are the key for vhosts... since it tricks $.couch into thinking you're at the root of a couchdb instance

http://wiki.couchapp.org/page/faq has some info under the 'How do I use $.couch.app() behind a vhost?' section

@rmetzler
Copy link
Contributor

rmetzler commented Nov 3, 2010

Rewrite rules can now be added in the rewrites.js file.

http://github.com/quirkey/soca/commit/9cbb2a545dd2473df89708edd8425d094cc27eba
http://github.com/quirkey/soca/commit/925472b2d737c2357e237ace8286e139884a64d4

I think about renaming the file into rewrites.json (couchapp uses the same filename) but config.js has also .js and not .json extension.

I thought about how to store the vhost setting: putting it into config.js vs creating a soca command. Any thoughts on this?

@max-mapper
Copy link
Author

ooh awesome.

keeping it in config.js makes sense, as you need admin rights in order to interact with the config api

@quirkey
Copy link
Owner

quirkey commented Nov 3, 2010

I know, this is awesome. Thanks @rmetzler!

I'm realizing that maybe it makes sense to add a config option for mapping JSON instead of just directories. That way you could get rid of the need for a special filename for rewrites and just make it in config.js:

    {
        "mapJSON": {
            "rewrites.js": "rewrites"
        },
        ....
    }

Also re:vhosts - I think it makes sense to make it a seperate command, but also be part of the config/push process. Well have to split it by env like:

   "vhosts": {
     "default": null,
     "production": "soca.quirkey.com"
   }

What do you guys think?

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