1. #1
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    603
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default Proxy URL suggestion

    Proxy URL suggestion


    Hi,
    I have a lot of Stores with JsonPProxys. They all have the same "start" URL and then a different ending and different params.

    But it would be awesome if it was possible to give som kind of "global" start. Because when I have to change from test to live and live to test there are many places I have to change the same thing. Would be nice if I just could change it one place.

    In ST1 I did something like:
    Code:
    url: glabalURL + 'special ending';

  2. #2
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,273
    Vote Rating
    81
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    Mmmm...

    Project's url prefix is not enough?

    Your URL should be relative to it, for example: "./rest/customers"

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  3. #3
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    603
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default


    Quote Originally Posted by ssamayoa View Post
    Mmmm...

    Project's url prefix is not enough?

    Your URL should be relative to it, for example: "./rest/customers"

    Regards.
    No, the code is "localhost" while developing and points to a development server where the development api is running.
    When the code is tested it is deployed on a test server and uses the test api.
    And at last it is "live", so the code is deployed live and points to the live api.

    The API are always on another domain then where the code is. So it can't be relative.

  4. #4
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,273
    Vote Rating
    81
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    I really dont understand your scenario.

    Why you dont have full API in your development environment relative to the projects' url?

    Or that API is 3r party? I mean, facebook or alike.

    What about override and global url prefix variable?
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  5. #5
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,306
    Vote Rating
    125
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    I understand your environment and we can make some considerations for this workflow in the future. This is not our current focus though.

    The situation is this:
    The client side application is running on a development web server locally (localhost).
    The applications API is running on a staging/development web server on another server.

    Right now we make the assumption that where you are developing the application will have those APIs available
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  6. #6
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,911
    Vote Rating
    63
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default


    Yeah this can be considered when we expand upon the deployment functionality. In that you could define a url prefix for different environments.
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

  7. #7
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    603
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default


    Correct.
    And the problem is that when developing I have to change on many stores/proxys and many places in the code. It's easy to forget one place.

    If I could use the trick from ST1 I would be happy.

  8. #8
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    603
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default


    Quote Originally Posted by Phil.Strong View Post
    Yeah this can be considered when we expand upon the deployment functionality. In that you could define a url prefix for different environments.
    That would be awesome! And I can use the prefix in the code and on the proxys.

  9. #9
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,273
    Vote Rating
    81
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    I still dont understand why you need that (may be because I always have a development environment like production one) but you could use an automated task (make, ant, shell script, etc.) before deploy which change the development prefix with production prefix in the exported JS sources.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  10. #10
    Sencha User
    Join Date
    Apr 2011
    Posts
    1
    Vote Rating
    0
    david.luna is on a distinguished road

      0  

    Default


    I think it will be very useful feature for Sencha Touch apps wrapped in Phonegap.