mirror of
https://github.com/yldio/copilot.git
synced 2024-11-28 06:00:06 +02:00
fix(portal-api): better handle dev enviroments
This commit is contained in:
parent
2f4e9d4a57
commit
4df7549799
@ -9,6 +9,13 @@ const Resolvers = require('./resolvers');
|
|||||||
const ContainerPilotWatcher = require('./watch/container-pilot');
|
const ContainerPilotWatcher = require('./watch/container-pilot');
|
||||||
const MachinesWatcher = require('./watch/machines');
|
const MachinesWatcher = require('./watch/machines');
|
||||||
|
|
||||||
|
const {
|
||||||
|
NAMESPACE
|
||||||
|
} = process.env;
|
||||||
|
|
||||||
|
const namespace = NAMESPACE
|
||||||
|
? `/${NAMESPACE}`
|
||||||
|
: '';
|
||||||
|
|
||||||
const internals = {};
|
const internals = {};
|
||||||
|
|
||||||
@ -59,6 +66,8 @@ module.exports = function (server, options, next) {
|
|||||||
{
|
{
|
||||||
register: Graphi,
|
register: Graphi,
|
||||||
options: {
|
options: {
|
||||||
|
graphqlPath: `${namespace}/graphql`,
|
||||||
|
graphiqlPath: `${namespace}/graphiql`,
|
||||||
schema: Schema,
|
schema: Schema,
|
||||||
resolvers: Resolvers(data)
|
resolvers: Resolvers(data)
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
"lint-ci": "belly-button",
|
"lint-ci": "belly-button",
|
||||||
"test": "lab -c",
|
"test": "lab -c",
|
||||||
"test-ci": "echo 0",
|
"test-ci": "echo 0",
|
||||||
"start": "node server.js"
|
"start": "node server.js",
|
||||||
|
"dev": "CORS=1 NAMESPACE=api node server.js"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "wyatt",
|
"author": "wyatt",
|
||||||
|
@ -14,7 +14,13 @@ const Fs = require('fs');
|
|||||||
const Url = require('url');
|
const Url = require('url');
|
||||||
|
|
||||||
const server = new Hapi.Server();
|
const server = new Hapi.Server();
|
||||||
server.connection({ port: 3000 });
|
|
||||||
|
server.connection({
|
||||||
|
port: 3000,
|
||||||
|
routes: {
|
||||||
|
cors: Boolean(process.env.CORS)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const swaggerOptions = {
|
const swaggerOptions = {
|
||||||
info: {
|
info: {
|
||||||
|
Loading…
Reference in New Issue
Block a user