parent
a9c67e70d4
commit
304722b528
4 changed files with 9 additions and 10 deletions
|
@ -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.
|
To run a POST or DELETE request, you can use the Fetch API. See the example in the next section.
|
||||||
|
|
|
@ -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.
|
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.
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ Run this in the metamaps directory, still as metamaps:
|
||||||
export NODE_ENV=production
|
export NODE_ENV=production
|
||||||
|
|
||||||
# create, load schema, seed
|
# create, load schema, seed
|
||||||
rake db:setup
|
rails db:setup
|
||||||
|
|
||||||
#### Install node & ES6 modules
|
#### 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.
|
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
|
bin/build-apidocs.sh
|
||||||
|
rails assets:precompile
|
||||||
|
rails perms:fix
|
||||||
|
|
||||||
#### Nginx and SSL
|
#### Nginx and SSL
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ Put the following code into `/etc/init/metamaps_delayed_worker.conf`:
|
||||||
respawn
|
respawn
|
||||||
respawn limit 3 30
|
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:
|
Then start the service and check the last ten lines of the log file to make sure it's running OK:
|
||||||
|
|
||||||
|
|
|
@ -24,10 +24,9 @@ Now that you have the code, run these commands:
|
||||||
|
|
||||||
bundle install
|
bundle install
|
||||||
npm install
|
npm install
|
||||||
rake db:migrate
|
rails db:migrate
|
||||||
rake assets:precompile # includes `npm run build`
|
rails assets:precompile # includes `npm run build` and `bin/build-apidocs.sh`
|
||||||
bin/build-apidocs.sh
|
rails perms:fix
|
||||||
rake perms:fix
|
|
||||||
passenger-config restart-app .
|
passenger-config restart-app .
|
||||||
|
|
||||||
forever list #find the uid of the realtime server, e.g. xQKv
|
forever list #find the uid of the realtime server, e.g. xQKv
|
||||||
|
|
Loading…
Add table
Reference in a new issue