Skip to content

Commit

Permalink
Add support for local Cosmos DB emulator
Browse files Browse the repository at this point in the history
Fixes issue evo-terren#58 by adding two optional parameters for Port and UseSSL to the constructor of the GraphClient class.
  • Loading branch information
Sam Hard committed Jul 2, 2019
1 parent 94e1fe8 commit e07d0a6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Gremlin.Net.CosmosDb/GraphClient.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Gremlin.Net.CosmosDb.Serialization;
using System;
using System.Threading.Tasks;
using Gremlin.Net.CosmosDb.Serialization;
using Gremlin.Net.CosmosDb.Structure;
using Gremlin.Net.Driver;
using Newtonsoft.Json.Linq;
using System;
using System.Threading.Tasks;

namespace Gremlin.Net.CosmosDb
{
Expand All @@ -25,9 +25,10 @@ public class GraphClient : IGraphClient, IDisposable
/// <param name="databaseName">Name of the database (case-sensitive).</param>
/// <param name="graphName">Name of the graph.</param>
/// <param name="accessKey">The access key.</param>
public GraphClient(string gremlinHostname, string databaseName, string graphName, string accessKey)
public GraphClient(string gremlinHostname, string databaseName, string graphName, string accessKey,
int port = 443, bool useSSL = true)
{
var server = new GremlinServer(gremlinHostname, 443, true, $"/dbs/{databaseName}/colls/{graphName}", accessKey);
var server = new GremlinServer(gremlinHostname, port, useSSL, $"/dbs/{databaseName}/colls/{graphName}", accessKey);

_gremlinClient = new GremlinClient(server, new GraphSONJTokenReader(), mimeType: GremlinClient.GraphSON2MimeType);
}
Expand Down

0 comments on commit e07d0a6

Please sign in to comment.