Scalable web server written in Go that uses JWT's for authentication and MongoDB to persist data. The GraphQL endpoint is /graphql
. The schemas for the implemented mutations and query can be found below. Since certain features like enforcing a certain password strength are not implemented yet, please use it with caution.
Add an .env
file according to the .example.env
file. Install dependencies with the command go get
and start the server with go run main.go
in the root folder.
mutation {
signUp(
input: {
email: "[email protected]"
firstName: "Some"
lastName: "User"
password: "example"
}
) {
token
}
}
mutation {
Login(
input: {
email: "[email protected]"
password: "example"
}
) {
token
}
}
Add an Authorization
header with a valid JWT as bearer token to the request. The following protected query can only be accessed if a valid JWT is provided.
query {
protected {
message
}
}