Welcome to the official Gopher Tunnels back-end repository!
git cloneYarn:
yarnnpm:
npm installYarn:
yarn devnpm:
npm run devInstall neo4j-driver-core and nodemon
Yarn:
yarn add neo4j-driver-core nodemonnpm:
npm install neo4j-driver-core nodemonFor testing, npm run dev will start the server and connect to the database
Routes:
Note: for query parameters, ensure all characters in string are lowercase
- '/route?'
- Service: routing from start to destination (between buildings only)
- Type: GET
- Query Params: (start: string), (destination: string)
- Ex: http://localhost:PORT/route?start=tate&destination=smith
- Will return an empty list if either query parameter isn't a building name or route isn't possible
- '/search?'
- Service: search bar functionality
- Type: GET
- Query Params: (name: string)
- Ex: 'http://localhost:PORT/route?name=g
- Will return an empty list if search input doesn't match any building names
Query the following buildings as they are spelled out
- smith
- kolthoff
- walter
- johnston
- northrop
- northrop garage
- morill
- tate
- murphy
- ford
- vincent
For searching (2), uppercase and lowercase letters don't matter, but adding in additional words like "walter library" or "john t. tate hall" won't work since the search doesn't match names on any substring, but rather the input substring starting from the beginning of the name (so "for" or "fo" would return information about Ford Hall, but "rd" or "ford hall" won't). Similarly for routing (1), the route also matches by name and must be lowercase.
Successful Connection to AuraDB:
Connection estabilished
ServerInfo {
address: ...,
agent: 'Neo4j/5.21-aura',
protocolVersion: 5.4
}Unsuccessful Connection:
Connection error
Neo4jError: Could not perform discovery. No routing servers available. Known routing table: RoutingTable[database=default database, expirationTime=0, currentTime=1720306255689, routers=[], readers=[], writers=[]]
Cause: Neo4jError: Failed to connect to server. Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0. Caused by: getaddrinfo ENOTFOUND 45511ca4.databases.neo4j.io
C:\Users\zhiya\OneDrive\Desktop\test-node\gt-back-end\node_modules\neo4j-driver-bolt-connection\node_modules\neo4j-driver-core\lib\error.js:75
_super.call(this, message, cause != null ? { cause: cause } : undefined) || this;
^
Neo4jError: Pool is closed, it is no more able to serve requests.
at new Neo4jError (C:\Users\zhiya\OneDrive\Desktop\test-node\gt-back-end\node_modules\neo4j-driver-bolt-connection\node_modules\neo4j-driver-core\lib\error.js:75:16)
at newError (C:\Users\zhiya\OneDrive\Desktop\test-node\gt-back-end\node_modules\neo4j-driver-bolt-connection\node_modules\neo4j-driver-core\lib\error.js:111:12)
at Pool.<anonymous> (C:\Users\zhiya\OneDrive\Desktop\test-node\gt-back-end\node_modules\neo4j-driver-bolt-connection\lib\pool\pool.js:229:68)
at step (C:\Users\zhiya\OneDrive\Desktop\test-node\gt-back-end\node_modules\neo4j-driver-bolt-connection\lib\pool\pool.js:49:23)
at Object.next (C:\Users\zhiya\OneDrive\Desktop\test-node\gt-back-end\node_modules\neo4j-driver-bolt-connection\lib\pool\pool.js:30:53)
at C:\Users\zhiya\OneDrive\Desktop\test-node\gt-back-end\node_modules\neo4j-driver-bolt-connection\lib\pool\pool.js:24:71
at new Promise (<anonymous>)
at __awaiter (C:\Users\zhiya\OneDrive\Desktop\test-node\gt-back-end\node_modules\neo4j-driver-bolt-connection\lib\pool\pool.js:20:12)
at Pool._acquire (C:\Users\zhiya\OneDrive\Desktop\test-node\gt-back-end\node_modules\neo4j-driver-bolt-connection\lib\pool\pool.js:222:16)
at Pool._processPendingAcquireRequests (C:\Users\zhiya\OneDrive\Desktop\test-node\gt-back-end\node_modules\neo4j-driver-bolt-connection\lib\pool\pool.js:401:22) {
constructor: [Function: Neo4jError] { isRetriable: [Function (anonymous)] },
code: 'N/A',
retriable: false
}Common causes for connection error:
- Instance is deleted or inactive
- Authentication credentials incorrect
- .env variables misconfigured
If you keep getting an unsuccessful connection to AuraDB, please bring it up!