chore(postgraphile): initial commit
This commit is contained in:
parent
35b5c708a9
commit
c5d5800a0e
|
@ -0,0 +1 @@
|
||||||
|
.env*
|
|
@ -0,0 +1,28 @@
|
||||||
|
require('dotenv').config();
|
||||||
|
const express = require("express");
|
||||||
|
const { postgraphile } = require("postgraphile");
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
|
||||||
|
const postgraphileOptions = {
|
||||||
|
watchPg: true,
|
||||||
|
dynamicJson: true,
|
||||||
|
setofFunctionsContainNulls: false,
|
||||||
|
ignoreRBAC: false,
|
||||||
|
showErrorStack: "json",
|
||||||
|
extendedErrors: ["hint", "detail", "errcode"],
|
||||||
|
exportGqlSchemaPath: "schema.graphql",
|
||||||
|
graphiql: true,
|
||||||
|
enhanceGraphiql: true,
|
||||||
|
allowExplain(_) {
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
enableQueryBatching: true,
|
||||||
|
legacyRelations: "omit",
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log('database url: ', process.env.DATABASE_URL);
|
||||||
|
app.use(postgraphile(process.env.DATABASE_URL, "public", postgraphileOptions));
|
||||||
|
|
||||||
|
console.log('port: ', process.env.PORT);
|
||||||
|
app.listen(process.env.PORT);
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"name": "postgraphile",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "Stefan Begerad",
|
||||||
|
"license": "GPL-3.0",
|
||||||
|
"dependencies": {
|
||||||
|
"dotenv": "16.4.5",
|
||||||
|
"express": "4.18.3",
|
||||||
|
"postgraphile": "4.13.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"nodemon": "3.1.0"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
```
|
||||||
|
npm i
|
||||||
|
node index.js
|
||||||
|
```
|
Loading…
Reference in New Issue