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
It's important to note the JWT secret being passed into the `Neo4jGraphQL` constructor in this example.
160
+
Additionally, create a file `utils.js` in the same directory and add the following code to it:
157
161
158
-
Additionally, the following code snippet provides an example implementation for the util functions `createJWT` and `comparePassword`:
159
162
[source, javascript, indent=0]
160
163
----
161
164
import bcrypt from "bcrypt";
@@ -188,10 +191,17 @@ export function comparePassword(plainText, hash) {
188
191
189
192
[NOTE]
190
193
====
191
-
This code for the util functions `createJWT` and `comparePassword` is an example.
194
+
The code for the util functions `createJWT` and `comparePassword` is an example.
192
195
Adjust it to suit your use case.
193
196
====
194
197
198
+
Install the additional dependencies:
199
+
200
+
[source, bash, indent=0]
201
+
----
202
+
npm install bcrypt jsonwebtoken
203
+
----
204
+
195
205
Back on the command line, run the following command to start your server:
196
206
197
207
[source, bash, indent=0]
@@ -211,15 +221,16 @@ You can execute the `signUp` mutation against the GraphQL API to sign up, but if
211
221
[[ogm-examples-rest-api]]
212
222
=== REST API
213
223
214
-
This example demonstrates how you might use the OGM without exposing a Neo4j GraphQL API endpoint. The example starts an https://expressjs.com/[Express] server and uses the OGM to interact with the Neo4j GraphQL Library, exposed via a REST endpoint.
224
+
This example demonstrates how you can use the OGM without exposing a Neo4j GraphQL API endpoint.
225
+
It starts an https://expressjs.com/[Express] server and uses the OGM to interact with the Neo4j GraphQL Library, exposed via a REST endpoint.
215
226
216
227
Execute the following to create an example application directory and create a new project:
217
228
218
229
[source, bash, indent=0]
219
230
----
220
231
mkdir ogm-rest-example
221
232
cd ogm-rest-example
222
-
npm init --yes
233
+
npm init es6 --yes
223
234
touch index.js
224
235
----
225
236
@@ -235,12 +246,12 @@ Assuming a running Neo4j database at "bolt://localhost:7687" with username "user
0 commit comments