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: README.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,12 +51,20 @@ Then generate your first API endpoint
51
51
$ gulp service --name yourFirstEndpoint // This command will create a CRUD endpoint for yourFirstEndpoint.
52
52
```
53
53
54
-
With the `gulp service` command, you have the option of using either Mongo DB for your database model or using an API generated by this Express Generator as a database model. To use an API as a database you can pass the `baseurl` and the `endpoint` for the API to the `gulp service `. See an example below
54
+
With the `gulp service` command, you have the option of using either Mongo DB, an SQL compatible DB or using an API generated by this Express Generator as a database model. To use an API as a database you can pass the `baseurl` and the `endpoint` option for the API to the `gulp service `; for an SQL compatible db, pass the `sql` option. See an example below
55
+
56
+
### Using an API as a DB
55
57
56
58
```
57
59
$ gulp service --name yourEndpointWithAPIAsDB --baseurl http://localhost:8080 --endpoint users
58
60
```
59
61
62
+
### Using an SQL compatible database
63
+
64
+
```
65
+
$ gulp service --name yourEndpointWITHSQL --sql
66
+
```
67
+
60
68
> Note: You can use -n instead of --name, -b instead of --baseurl, -e instead of --endpoint
61
69
62
70
Try out your new endpoint.
@@ -94,6 +102,8 @@ You will now be able to access CRUD (create, read, update and delete) endpoints
94
102
`[DELETE] http://localhost:8080/yourFirstEndpoint/:id` Delete one yourFirstEndpoint resource
95
103
`[POST] http://localhost:8080/yourFirstEndpoint/:id/restore` Restore a previously deleted yourFirstEndpoint resource
96
104
105
+
> Note: For every `POST` API calls you need to send an `x-tag` value in the header. This value is used for secure communication between the server and client. It is used for AES encrytion when secure mode is enabled. To get a valid `x-tag` call the `[GET] /initialize` endpoint.
106
+
97
107
## Versioning your API endpoints
98
108
99
109
You can create multiple versions of your API endpoints by simply adding the version number to your route file name. eg. `users.v1.js` will put a version of the users resources on the `/v1/users` endpoint. users.v2.js will put a version of the users resources on the `/v2/users` endpoint. The latest version of the resources will always be available at the `/users` endpoint.
0 commit comments