fix api docs (#897)

* fix api docs

* more rake => rails
This commit is contained in:
Devin Howard 2016-11-01 09:52:10 +08:00 committed by GitHub
parent a9c67e70d4
commit 304722b528
4 changed files with 9 additions and 10 deletions

View file

@ -1,3 +1,3 @@
One way to access the API is through your browser. Log into metamaps.cc normally, then browse manually to https://metamaps.cc/api/v2/user/current. You should see a JSON description of your own user object in the database. You can browse any GET endpoint by simply going to that URL and appending query parameters in the URI.
One way to access the API is through your browser. Log into metamaps.cc normally, then browse manually to https://metamaps.cc/api/v2/users/current. You should see a JSON description of your own user object in the database. You can browse any GET endpoint by simply going to that URL and appending query parameters in the URI.
To run a POST or DELETE request, you can use the Fetch API. See the example in the next section.

View file

@ -1,4 +1,4 @@
If you are logged into the API via another means, you can create a token. Once you have this token, you can append it to a request. For example, opening a private window in your browser and browsing to `https://metamaps.cc/api/v2/user/current?token=...token here...` would show you your current user, even without logging in by another means.
If you are logged into the API via another means, you can create a token. Once you have this token, you can append it to a request. For example, opening a private window in your browser and browsing to `https://metamaps.cc/api/v2/users/current?token=...token here...` would show you your current user, even without logging in by another means.
To get a list of your current tokens, you can log in using cookie-based authentication and run the following fetch request in your browser console (assuming the current tab is on some page within the `metamaps.cc` website.

View file

@ -58,7 +58,7 @@ Run this in the metamaps directory, still as metamaps:
export NODE_ENV=production
# create, load schema, seed
rake db:setup
rails db:setup
#### Install node & ES6 modules
@ -70,9 +70,9 @@ Run this in the metamaps directory, still as metamaps:
This step depends on running npm install first; assets:precompile will run `NODE_ENV=production npm run build`, and the build-apidocs.sh script requires the raml2html npm package.
rake assets:precompile
rake perms:fix
bin/build-apidocs.sh
rails assets:precompile
rails perms:fix
#### Nginx and SSL
@ -119,7 +119,7 @@ Put the following code into `/etc/init/metamaps_delayed_worker.conf`:
respawn
respawn limit 3 30
exec bundle exec rake jobs:work
exec bundle exec rails jobs:work
Then start the service and check the last ten lines of the log file to make sure it's running OK:

View file

@ -24,10 +24,9 @@ Now that you have the code, run these commands:
bundle install
npm install
rake db:migrate
rake assets:precompile # includes `npm run build`
bin/build-apidocs.sh
rake perms:fix
rails db:migrate
rails assets:precompile # includes `npm run build` and `bin/build-apidocs.sh`
rails perms:fix
passenger-config restart-app .
forever list #find the uid of the realtime server, e.g. xQKv