https://github.com/akimalunar/pretty-prism-node
GraphQL API on Node.js, Express & Mongo (ES6 w/ Babel)
https://github.com/akimalunar/pretty-prism-node
es6 express graphql graphql-subscriptions nodejs
Last synced: 21 days ago
JSON representation
GraphQL API on Node.js, Express & Mongo (ES6 w/ Babel)
- Host: GitHub
- URL: https://github.com/akimalunar/pretty-prism-node
- Owner: AkimaLunar
- Created: 2017-11-01T20:39:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-28T23:39:54.000Z (over 7 years ago)
- Last Synced: 2025-02-02T05:26:24.380Z (8 months ago)
- Topics: es6, express, graphql, graphql-subscriptions, nodejs
- Language: JavaScript
- Homepage: http://api.prettyprism.com/playground
- Size: 171 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PrettyPrism: GraphQL Server
GraphQL API on Node.js, Express & Mongo (ES6 w/ Babel)
http://api.prettyprism.com/playground### Project setup
1. Download the dependencies `yarn install`
2. Create a `.env` file with environment variables:
```
PORT=8282
DATABASE_URL=...
JWT_SECRET=...
JWT_EXPIRY=7d
ENV=...
ACCESS_KEY_ID=...
SECRET_ACCESS_KEY=...
BUCKET=...
REGION=...
```3. Run `yarn run dev`
### Playground
GraphiQL interface is available at http://localhost:8282/playground for
reference and testing queries.### Nginx configuration
This configuration is required to establish a websocket connection with GraphQL
Subscriptions.`/etc/nginx/nginx.conf`
```
http {
...map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}...
}
````/etc/nginx/sites-available/api.prettyprism.com`
```
server {
server_name api.prettyprism.com;
access_log /var/www/api/logs/access.log;
error_log /var/www/api/logs/error.log;location / {
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;
}location /subscriptions {
proxy_pass http://127.0.0.1:8080/subscriptions;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}}
```