Closed hacksparrow closed 8 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 }
.
@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?
@bajtos thanks, I will do that.
@bajtos what about loopback#rest
and loopback#urlNotFound
in middleware.json
? I guess they stay as such like loopback#favicon
?
@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
}
@bajtos also url
is not a listed property. Do we get rid of it it too?
@bajtos and also noticed that the dependencies in the app generated by slc loopback
are outdated.
also url is not a listed property. Do we get rid of it it too?
yes please
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.
@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
.
@bajtos @crandmck ready to merge?
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.
Made the changes. @bajtos
Landed via 7e58c63, thank you!
Updates the example to use
loopback
2 and its conventions.