Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Node.js example using EdgeDB Auth #112

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

scotttrinh
Copy link
Contributor

@scotttrinh scotttrinh commented Nov 3, 2023

To accompany the EdgeDB Auth Guide, this is an example of a complete stock Node.js HTTP server that exercises the EdgeDB Auth extension.

TODO in future effort:

  • Show protecting a route by looking for the cookie
  • Show making an authenticated (access policy) query using the auth token
  • Add a simple-as-possible HTML interface

@scotttrinh scotttrinh requested a review from raddevon November 3, 2023 00:48
@scotttrinh scotttrinh changed the title Add NodeJS example using EdgeDB Auth Add Node.js example using EdgeDB Auth Nov 3, 2023
Copy link
Contributor

@raddevon raddevon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested a small fix in the package.json.

When I try edgedb project init, I'm getting edgedb error: cannot find package matching 5.0.. Should the version in edgedb.toml be 5.0 or 4.0?

It might be nice to add a readme with some basic stuff. If we just included a few steps on how to get the project running and a link to the guide, that could be enough for starters. It might also be nice to tell how to get the Nix environment up and running but also mention that it is optional so people know they can run the app without that.

nodejs-auth/package.json Outdated Show resolved Hide resolved
@scotttrinh
Copy link
Contributor Author

When I try edgedb project init, I'm getting edgedb error: cannot find package matching 5.0.. Should the version in edgedb.toml be 5.0 or 4.0?

Interesting. I don't think I actually made this edgedb.toml explicitly. I think it should be like 4.x or something like that. Will fix!

It might be nice to add a readme with some basic stuff. If we just included a few steps on how to get the project running and a link to the guide, that could be enough for starters.

Yeah, that makes sense to me.

It might also be nice to tell how to get the Nix environment up and running but also mention that it is optional so people know they can run the app without that.

Yeah, I think we can get this with a "Requirements" section that shows how to use the Nix flake, or if you do not have Nix installed, what the requirements are. Should make it clear that the Nix flake manages the environment dependencies for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants