How do I access my project after starting a local ...
# orm-help
m
How do I access my project after starting a local cluster with
prisma local start
?
n
What do you mean with accessing your project?
m
Open the playground locally for my api
n
A cluster hosts many services. If you never deployed a service to your cluster, there is no service yet.
m
Ah, got it
n
So, you can do
Copy code
prisma init test
cd test
prisma deploy # choose local
prisma playground
m
Yeah, I thought that was being done automatically. Need moar coffee!
n
service/stage will be optional in an upcoming version: https://github.com/graphcool/prisma/issues/2217
then there will be a "default" service for a cluster
but today is not the day!! 😂
m
cool! thanks nilan 😄
🙌 1
So, I just tested with
prisma init
and chose the TypeScript advanced with auth and when I try running the playground after a deploy I get
Your token is invalid. It might have expired or you might be using a token from a different project.
I am guessing this has to do with auth? 😛
n
Yes. you can protect your Prisma API with a secret (entered in
prisma.yml
)
To generate a token that is signed with this secret, run
prisma token
m
Great
n
Then set the authorization header to access your Prisma API:
Copy code
{
  "Authorization": "Bearer <token>"
}
m
I just added a Authorization header with a Bearer token
Seems to work fine 🙂
n
woop woop 🎉