Skip to content

Conversation

@stephenplusplus
Copy link
Contributor

Fixes #389

While running the gcd server, this now works:

// gcd is running on localhost:8080

var gcloud = require("gcloud")

var ds = gcloud.datastore.dataset({
  apiEndpoint: "localhost:8080",
  projectId: "nth-circlet-705"
})

var company = ds.key("company")

ds.save({
  key: company,
  data: { name: "google" }
}, function (err) {
  if (err) throw err

  ds.get(company, console.log)
})

I'm not sure host and port are technically correct argument names, since for this PR, "host" needs to be in the format of protocol + host ("http://localhost"). Ideas I can think of:

  • Ditch host and port in favor of one argument name to include protocol + host + port (but not a path):
    • uri
    • resource
    • api
    • apiPrefix
  • Accept protocol, host, and port
  • Not worry about it

Interested in your thoughts!

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 23, 2015
@stephenplusplus stephenplusplus added the api: datastore Issues related to the Datastore API. label Feb 23, 2015
@stephenplusplus stephenplusplus added this to the Datastore Stable milestone Feb 23, 2015
@stephenplusplus stephenplusplus force-pushed the spp--support-local-datastore branch 2 times, most recently from 5d9832d to 009d76c Compare February 23, 2015 15:48

This comment was marked as spam.

This comment was marked as spam.

@ryanseys
Copy link
Contributor

Re: protocol, host and port why not just accept a customEndpoint value that can be set to something like "http://localhost:8080" and our default will be "https://www.googleapis.com" where the port of 443 is implied. Right now if they just specify a host, the default port is assumed 443 which won't work for them if they are on http.

This comment was marked as spam.

@ryanseys
Copy link
Contributor

Looks good to me otherwise. Let me know what you think about just one string for configuration e.g. "http://localhost:8080" instead of two or three.

@stephenplusplus
Copy link
Contributor Author

Re: protocol, host and port why not just accept a customEndpoint value that can be set to something like "http://localhost:8080" and our default will be "https://www.googleapis.com" where the port of 443 is implied.

SGTM. 👍

@stephenplusplus
Copy link
Contributor Author

Sent in an update using apiEndpoint. Also, instead of throwing if a user doesn't include a protocol, it will default to http://. Let me know if you catch anything I overlooked.

This comment was marked as spam.

This comment was marked as spam.

@ryanseys
Copy link
Contributor

Cool beans. Looks good. Just could benefit from a couple example as I commented.

@stephenplusplus stephenplusplus force-pushed the spp--support-local-datastore branch from 5a44544 to 78358d4 Compare February 24, 2015 18:59
@stephenplusplus
Copy link
Contributor Author

Good idea. Added those: 78358d4

ryanseys added a commit that referenced this pull request Feb 24, 2015
@ryanseys ryanseys merged commit fe10aa5 into googleapis:master Feb 24, 2015
@ryanseys
Copy link
Contributor

Thanks! 💃

chingor13 pushed a commit that referenced this pull request Aug 22, 2022
* chore: clean up Node.js TOC for cloud-rad

Source-Author: F. Hinkelmann <[email protected]>
Source-Date: Wed Oct 21 09:26:04 2020 -0400
Source-Repo: googleapis/synthtool
Source-Sha: f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8
Source-Link: googleapis/synthtool@f96d3b4

* chore: fix Node.js TOC for cloud-rad

Source-Author: F. Hinkelmann <[email protected]>
Source-Date: Wed Oct 21 12:01:24 2020 -0400
Source-Repo: googleapis/synthtool
Source-Sha: 901ddd44e9ef7887ee681b9183bbdea99437fdcc
Source-Link: googleapis/synthtool@901ddd4
sofisl pushed a commit that referenced this pull request Sep 15, 2022
sofisl pushed a commit that referenced this pull request Sep 16, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/d365a9d3-f86e-4598-8272-bbf6b821e385/targets

- [ ] To automatically regenerate this PR, check this box.
sofisl pushed a commit that referenced this pull request Oct 5, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/d365a9d3-f86e-4598-8272-bbf6b821e385/targets

- [ ] To automatically regenerate this PR, check this box.
sofisl pushed a commit that referenced this pull request Sep 13, 2023
sofisl pushed a commit that referenced this pull request Sep 14, 2023
GautamSharda pushed a commit that referenced this pull request Jan 14, 2026
GautamSharda pushed a commit that referenced this pull request Jan 20, 2026
GautamSharda pushed a commit that referenced this pull request Jan 21, 2026
sofisl pushed a commit that referenced this pull request Jan 27, 2026
sofisl pushed a commit that referenced this pull request Jan 27, 2026
sofisl pushed a commit that referenced this pull request Jan 28, 2026
miguelvelezsa pushed a commit that referenced this pull request Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: datastore Issues related to the Datastore API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support datastore on local development server

3 participants