You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/HowToUse.md
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -2,26 +2,25 @@ Once you've installed the
2
2
3
3
4
4
## API Spec
5
-
The Bmore Responsive API is documented via a OAS 3.0 API spec in the `swagger.json` file. This API spec lists all the end points, supported REST actions, request parameters and response data formats. While you can open the `swagger.json` file in any text editor, there are better ways to view it in a richer format, such as:
5
+
The Bmore Responsive API is documented via a OAS 3.0 API specification in the file `swagger.json`. This API spec lists all the endpoints, supported REST actions, and the request and response data formats. While you can open the `swagger.json` file in any text editor, there are better ways to view it in a richer format, such as:
6
6
7
7
- View the [API Spec on Swaggerhub](https://app.swaggerhub.com/apis/codeforbaltimore/bmoreResponsive)
8
-
- If you are running Bmore Responsive, then you can just point your browser at the root URL of your server, often `http://localhost:3000/`, you'll be redirected to `http://localhost:3000/api-docs/`.
8
+
- If you are running Bmore Responsive, then you can just point your browser at the root URL of your server, often `http://localhost:3000/`, you'll be redirected to `http://localhost:3000/api-docs/`
9
9
10
10
## Postman Collection
11
11
12
-
For a library (aka collection) of sample API calls, please refer to Postman the collection saved as `Bmore-Responsive.postman_collection.json`. Need Postman? Click [here](https://www.postman.com/downloads/).
12
+
For a library of sample API calls, please refer to the Postman collection `Bmore-Responsive.postman_collection.json`. Need Postman? Click [here](https://www.postman.com/downloads/).
13
13
14
14
<TODO: Add explanation of folder structure, tests, token mgmt and dependencies, environments/variables>
15
15
16
16
## Authentication
17
17
18
-
The Bmore Responsive API provides security by limiting use of nearly all feature to authenticated users. If you have NOT disabled login, you'll need to pass a token (aka "JWT") with every call, except `/health` and `/user/login` endpoints. To get this token, you'll need to pass a valid username and password to `/user/login` which will reply with a JWT. This JWT should be passed as a query parameter named `token`. This token will expire after a short period of time. Once expired you can get a new token by another call to `user/login`.
18
+
The Bmore Responsive API provides security by limiting use of nearly all features to authenticated users. If you have NOT disabled login, you'll need to pass a [JSON Web Token (JWT)](https://jwt.io/) with every call to a secured endpoint. Only the login (`/user/login`) and health (`/health`) endpoints are unsecured. To get a JWT, you'll need to pass a valid username and password to `/user/login`; the encoded JWT is the response body. This JWT should be passed as the `Authorization` header using the `Bearer`[authentication scheme](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). This token will expire after a short period of time. If it expires, you can get a new token by making another call to `user/login`.
19
19
20
20
_Note: If you have used the db-seed script, you'll already have a user account created that will enable you to login. This default login is username `homer.simpson@sfpp.com` and password `donuts`._
21
21
22
22
<TODO: Add subsections to describe common tasks like adding user, adding role, setting/changing access, adding entity, relating contact to entity, etc...>
23
23
24
-
25
24
## Seed and re-seed the database
26
25
27
26
This repo has four scripts that simplifies the creation and loading of the database. These script commands are as follows:
*Note: The DATABASE_URL above asserts that your username and password for your DB are both `postgres` as the URL format is generally `postgres://user:pass@example.com:5432/dbname`.*_We highly recommend_*changing these values in this step and the following step.*
36
+
*Note: The settings above assume that your username and password for your DB are both `postgres`.*_We highly recommend_*changing these values in this step and the following step.*
33
37
34
38
## Step 4 - Start Up a Database
35
39
@@ -47,11 +51,11 @@ To populate the DB with sample users, entities and contacts that may resemble th
47
51
48
52
## Step 6 - Run Server
49
53
50
-
To run the application run `npm start`. Your terminal output should end with a line like `Bmore Responsive is available at http://localhost:5000`
54
+
To run the application run `npm start`. Your terminal output should end with a line like `Bmore Responsive is available at http://localhost:3000`
51
55
52
56
## Step 7 - Confirm Success
53
57
54
-
To confirm the server is running, just point your browser to [http://localhost:5000/entity](http://localhost:5000/entity) (or just add "/entity" to the URL from the previous step). A response like the sample below lets you know your server is healthy.
58
+
To confirm the server is running, just point your browser to [http://localhost:3000/entity](http://localhost:3000/entity) (or just add "/entity" to the URL from the previous step). A response like the sample below lets you know your server is healthy.
0 commit comments