Skip to content
This repository was archived by the owner on Apr 18, 2020. It is now read-only.

Feature/api app cleanup - #16

Merged
bajtos merged 2 commits into
masterfrom
feature/api-app-cleanup
May 30, 2014
Merged

bajtos merged 2 commits into
masterfrom
feature/api-app-cleanup

Conversation

@bajtos

@bajtos bajtos commented May 30, 2014

Copy link
Copy Markdown
Member
  • move code out of api/app.api.js to api/boot/*.js
  • add api/app.json and friends to configure the api app

/to @ritch please review.

I have a concern about the proposed usage of app.json. The main app file app.api.js matches the pattern used by loopback-boot when NODE_ENV=api. Here are few options how to address that:

  1. Add a config option to loopback-boot to specify a different prefix for app config files, e.g. app.api instead of the default app. The config files in this project will be renamed to app.api.json and app.api.local.js.
  2. Modify loopback-boot to use .json.js instead of .js, i.e. app.local.json.js.
  3. Rename app.api.js, but that will break the concept of having app.js with the app source code and app.json with the app configuration.

Thoughts?

Miroslav Bajtoš added 2 commits May 30, 2014 09:30
Add api/boot/authentication.js to enable authentication once we are
ready for that.

Add api/boot/change-tracking.js to expose Todo's ChangeModel.
Add `api/app.json` and `api/app.local.json` to configure the api server.

Modify api/app.api.js to load these config files via loopback-boot
and use `server.get('restApiRoot')` instead of `CONFIG.api.root`.
Comment thread api/app.api.js

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of loopback v1.8.4 and 2.0.0-beta3, loopback.token() is automatically included by loopback.rest() when auth is enabled (see strongloop/loopback#263).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool

@bajtos bajtos added this to the 1.0 milestone May 30, 2014
@ritch

ritch commented May 30, 2014

Copy link
Copy Markdown
Member

LGTM (though some of this might change today)

bajtos added a commit that referenced this pull request May 30, 2014
@bajtos
bajtos merged commit d35e5a3 into master May 30, 2014
Comment thread api/app.local.js

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be obsoleted by a global config js file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, feel free to make that change.

@bajtos
bajtos deleted the feature/api-app-cleanup branch May 30, 2014 18:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants