The server of my-app-universal
- Yarn
# Clone the repo
$ git clone /~https://github.com/cesaraaron/my-app-server && cd my-app-server
# Install dependencies
$ yarn install
If you already have a prima server up and running, create a .env.local
file on the root directory with the following keys set to:
PRISMA_ENDPOINT= # the url of the prisma server
PRISMA_SECRET= # can be anything
APP_SECRET= # can be anything
Then run:
$ yarn deploy
If you don't have a server:
$ yarn deploy -n
When prompt:
-
Use a demo server.
-
If you haven't registered with Prisma Cloud before, the CLI will now open a browser window asking you to sign up.
-
Follow the instructions in the browser to register with Prisma Cloud.
-
Select either demo-eu1 or demo-us1
-
Just confirm the suggested values by hitting Enter two times.
Copy the endpoint
value of ./database/prisma.yml and paste it into PRISMA_ENDPOINT
of .env.local
Start the development server:
$ yarn dev
Make sure the
managementApiSecret
of docker-compose.yaml matches thePRISMA_MANAGEMENT_API_SECRET
in.env.production
before deploying.
# Clone the repo
$ git clone /~https://github.com/cesaraaron/my-app-server && cd my-app-server
# Install dependencies
$ yarn install
# Fetch the prisma & mysql docker images and run them in the background
$ docker-compose up -d
# Build the graphql-yoga server
$ yarn build
# Create a local .env.production file on your server and add your env variables
# If you already have a .env.production file with all the 4 varialbes set, skip this step.
$ cp .env .env.production && vim .env.production
# Run the graphql-yoga server in the background
$ dotenv -e .env.production -- pm2 start dist/index.js --name my-app-server
This project is licensed under the MIT License - see the LICENSE.md file for details