From 304722b528c3f4374f6783afb1c027293994fed3 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Tue, 1 Nov 2016 09:52:10 +0800 Subject: [PATCH] fix api docs (#897) * fix api docs * more rake => rails --- doc/api/pages/cookie_tutorial.md | 2 +- doc/api/pages/token_tutorial.md | 2 +- doc/production/first-deploy.md | 8 ++++---- doc/production/pull-changes.md | 7 +++---- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/doc/api/pages/cookie_tutorial.md b/doc/api/pages/cookie_tutorial.md index 9481b919..7bfa0825 100644 --- a/doc/api/pages/cookie_tutorial.md +++ b/doc/api/pages/cookie_tutorial.md @@ -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. diff --git a/doc/api/pages/token_tutorial.md b/doc/api/pages/token_tutorial.md index 3a46582a..b0d20ca4 100644 --- a/doc/api/pages/token_tutorial.md +++ b/doc/api/pages/token_tutorial.md @@ -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. diff --git a/doc/production/first-deploy.md b/doc/production/first-deploy.md index b118a2b5..26d311e7 100644 --- a/doc/production/first-deploy.md +++ b/doc/production/first-deploy.md @@ -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: diff --git a/doc/production/pull-changes.md b/doc/production/pull-changes.md index 1bd1ebbe..751b8b38 100644 --- a/doc/production/pull-changes.md +++ b/doc/production/pull-changes.md @@ -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