strongloop / loopback-example-offline-sync

Offline sync, change tracking, and replication.
http://loopback.io/doc/en/lb2/Synchronization.html
Other
285 stars 110 forks source link

Update to loopback 2 #73

Closed hacksparrow closed 8 years ago

hacksparrow commented 9 years ago

Updates the example to use loopback 2 and its conventions.

bajtos commented 9 years ago

I'd like to keep offline-sync example as close to the output of slc loopback as possible.

For middleware config, see the template in loopback-workspace. Please move compression to initial phase and add cors middleware to the initial phase too.

Check also server/config.json as generated from this template and apply necessary changes to server/config.json in this project too. The items are in the format {name: KEY, value: VALUE } which is converted to JSON config as { KEY: VALUE }.

bajtos commented 9 years ago

@hacksparrow I have fixed CI build failures in https://github.com/strongloop/loopback-example-offline-sync/pull/74, could you please rebase this patch on top of the current master and make sure that jshint . && npm test passes?

hacksparrow commented 9 years ago

@bajtos thanks, I will do that.

hacksparrow commented 9 years ago

@bajtos what about loopback#rest and loopback#urlNotFound in middleware.json? I guess they stay as such like loopback#favicon?

hacksparrow commented 9 years ago

@bajtos and regarding server/config.json, the properties name and main should be removed? Or should they be merged with the following?

{
  "restApiRoot": "/api",
  "host": "0.0.0.0",
  "port": 3000,
  "remoting": {
    "context": {
      "enableHttpContext": false
    },
    "rest": {
      "normalizeHttpPath": false,
      "xml": false
    },
    "json": {
      "strict": false,
      "limit": "100kb"
    },
    "urlencoded": {
      "extended": true,
      "limit": "100kb"
    },
    "cors": false,
    "errorHandler": {
      "disableStackTrace": false
    }
  },
  "legacyExplorer": false
}
hacksparrow commented 9 years ago

@bajtos also url is not a listed property. Do we get rid of it it too?

hacksparrow commented 9 years ago

@bajtos and also noticed that the dependencies in the app generated by slc loopback are outdated.

bajtos commented 9 years ago

also url is not a listed property. Do we get rid of it it too?

yes please

bajtos commented 9 years ago

what about loopback#rest and loopback#urlNotFound in middleware.json? I guess they stay as such like loopback#favicon

Yes, they don't exist as a standalone module.

And regarding server/config.json, the properties name and main should be removed? Or should they be merged with the following?

I am not sure what are the purpose of these two properties, I am ok to keep them in (for now).

and also noticed that the dependencies in the app generated by slc loopback are outdated.

I believe the deps use ^ operator to always fetch the latest compatible versions, isn't it so? However, feel free to send a PR to loopback-workspace to update the minimum supported versions.

hacksparrow commented 9 years ago

@bajtos made all the changes you suggested.

I believe the deps use ^ operator to always fetch the latest compatible versions, isn't it so?

The loopback-explorer version is generated at ^1.1.0.

hacksparrow commented 9 years ago

@bajtos @crandmck ready to merge?

bajtos commented 9 years ago

The loopback-explorer version is generated at ^1.1.0.

Oh yes, we need to update the generator using the changes from https://github.com/strongloop/loopback-example-app/pull/77.

hacksparrow commented 8 years ago

Made the changes. @bajtos

bajtos commented 8 years ago

Landed via 7e58c63, thank you!