Closed kgodard closed 9 years ago
Hey @kgodard, long time no chat :)
What does your config/application.coffee
look like in reference to customUrlPath
?
This is what my config/application.coffee
file looks like at the moment, in case this sheds any light on the question:
module.exports = require(process.env['LINEMAN_MAIN']).config.extend("application",
#Override application configuration here
homepage:
template: "app/templates/homepage.hb"
dev:
context:
relativeUrlRoot: "/development"
pages:
dev:
context:
relativeUrlRoot: "/development"
concat:
js:
separator: ";"
server:
base: "generated"
web:
port: 8000
apiProxy:
enabled: true
host: "localhost"
port: 3000
customUrlPath: "/development/engagement"
watch:
less:
files: ["<%= files.less.vendor %>", "app/css/**/*.less"]
tasks: ["less", "concat:css"]
)
hey man!
so funny I was pasting that just as you were asking for it :)
Also keep in mind that you guys are the only people I know of that use this feature
On Tue, Apr 8, 2014 at 3:55 PM, Kim Godard notifications@github.com wrote:
This is what my
config/application.coffee
file looks like at the moment, in case this sheds any light on the question:module.exports = require(process.env['LINEMAN_MAIN']).config.extend("application", #Override application configuration here homepage: template: "app/templates/homepage.hb" dev: context: relativeUrlRoot: "/development" pages: dev: context: relativeUrlRoot: "/development" concat: js: separator: ";" server: base: "generated" web: port: 8000 apiProxy: enabled: true host: "localhost" port: 3000 customUrlPath: "/development/engagement" watch: less: files: ["<%= files.less.vendor %>", "app/css/**/*.less"] tasks: ["less", "concat:css"] )
Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/pull/245#issuecomment-39894156
sure, if there's some way to do something like that without touching the lineman base task configs, that would be great...
So basically you just want a way to mount the express static directory so that it recognizes the customUrlPath?
Is this purely a cosmetic desire or are you intending to use this to hardcode url segments against in API calls?
It's really about matching our weird production paths. We've had issues with image paths and things because production is running on things like /dukehes/engagement
, but locally we're running off of just /
Yeah that makes sense, and development should be as close to mirroring production as possible. If it's causing pain when managing image paths in style sheets then that's definitely not ideal. Are you opposed to running against a fork of Lineman for a bit to see if this causes you any problems before we merge it?
I don't think we'd mind that at all, but let me double-check with @jrush to confirm.
Also, could you update the relevant section in the docs: https://github.com/linemanjs/lineman-docs and submit a PR there so this change is covered? :)
@davemo our question is, how do we do that? is it simple to run lineman off of a fork? are we talking about symlinking to it from /usr/local/lib/node_modules, or is there some npm
way of setting up a fork? We don't know sh-- about node stuff :(
Oh, you can point the reference to lineman in your package.json
to a git URI.
"dependencies": {
"public": "git://github.com/user/repo.git#ref"
, "private": "git+ssh://git@github.com:user/repo.git#ref"
}
just replace public
and/or private
with lineman
, and the URI's pointing to your fork and ref (branch).
yes I can certainly add the relevant info to the docs.
oh, ok. Do I need both the public and private options? Or is that just standard convention
Those were just examples, pick one depending on if the URI you are linking to is a private repo or public.
ok, got it.
With that in place, npm install
will pull lineman from your fork.
and it will install it locally in our app/node_modules dir, correct?
Yup!
cool. that seems simple enough
If things work good for you, then we'll get this merged and cut a release so you can switch over to the new version instead of your fork; we've just found that server.coffee
is one of the oldest areas of Lineman and it has a number of complex uses so it's been prone to fragility.
@jasonkarns has a branch that refactors it and adds tests but we haven't merged it yet. Once this has had some time in your development environment and doesn't appear to cause any other issues we'll merge it in :)
ok fair enough, thanks
Hey @kgodard should this be closed? Did something else fix your thing by now?
I'd really like this too.
Is there any way we can get this in the new version?
My remote environment runs the app on:
so i want to run it locally as
http://localhost:8000/subdir/ and I have to reference all of my assets in my index.us like "/subdir/js/app.js"
but the api i want to proxy is remote and does not include /subdir/. Its totally different, ie.
http://someapihost.com:8080/api
So I could really use a way to mount my static website / assets without messing with the apiProxy.
Thanks!
That depends whether it actually worked. @kgodard?
On Sat, Jul 19, 2014 at 1:14 AM, Julia Jacobs notifications@github.com wrote:
I'd really like this too. Is there any way we can get this in the new version?
Thanks!
Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/pull/245#issuecomment-49490044
It ended up not being a significantly better solution than just using the “relativeUrlRoot” param in the application config, which is what we ultimately chose to do. It did seem to work though.
On Jul 19, 2014, at 12:56 AM, Justin Searls notifications@github.com<mailto:notifications@github.com> wrote:
That depends whether it actually worked. @kgodard?
On Sat, Jul 19, 2014 at 1:14 AM, Julia Jacobs notifications@github.com<mailto:notifications@github.com> wrote:
I'd really like this too. Is there any way we can get this in the new version?
Thanks!
Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/pull/245#issuecomment-49490044
— Reply to this email directly or view it on GitHubhttps://github.com/linemanjs/lineman/pull/245#issuecomment-49501711.
Thats too bad :(
This is a requirement for us to maintain consistency between our local dev and remote environments.
I'll have to maintain a separate version of lineman for our team with the change which we are using now: https://github.com/rackerlabs/lineman
Which kind of stinks.
Update - oh sorry I didn't realize this change had been rejected. I just wanted to also confirm the change works and we are using this version now.
It's Monday . . . .
Hey @jewelsjacobs -- I struggled to understand a little bit from your comment what you need and how lineman should work better for you. We had some additional background knowledge of @kgodard's needs which were very specific and as a result, the fact that you would like the same feature doesn't really explain to us why it's valuable.
Would you mind explaining what you'd like Lineman to do in clear, simple terms? If it's easier to just look at your fork's commits, feel free to refer me to those.
RFC - probably don't merge
We would like to be able to emulate our production paths as closely as possible in development. What we want is to mount the app at something like
/development/engagement
, but still hit the back-end API at/development/api/...
Using the
relativeUrlRoot
option, I have not been able to figure out a way to do this. It appears that therelativeUrlRoot
option is used both by the api proxy and by the express server, and therefore it will only work if we want the same relative path for both servers.This works, but I am aware that with my complete lack of "node/express"-fu, this is quite possibly the WRONG way to do this, so I'm asking for input. Is this reasonable? Or am I completely missing something obvious in the application config options?