-
-
Notifications
You must be signed in to change notification settings - Fork 610
Closed
Labels
✋ release blockerprevents releasing the next versionprevents releasing the next version💅 enhancement
Milestone
Description
I'm submitting a ...
- bug report
- feature request
- question
PostGraphile version: 4.0.0b7
Steps to reproduce
Environment variables:
- "NODE_ENV": "production",
- "PORT": "3000",
- "PGHOST": "localhost",
- "PGPORT": "5432",
- "PGUSER": "postgres",
- "PGPASSWORD": "secret",
- "PGDATABASE": "my_db"
Server code (TypeScript)
import * as express from "express";
import { postgraphile } from "postgraphile";
const app = express();
const router = express.Router();
router.use(postgraphile(undefined, { graphiql: true }));
app.use("/subdir", router); // ** important ** express listens for anything in the "subdir" subdirectory
app.listen(process.env.PORT || 3000);Current behavior:
When requesting localhost:3000/subdir/graphiql, the page is unable to load its assets due to relative URLs lacking a leading period (.).
Current page source:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>GraphiQL</title>
<meta name="robots" content="noindex" />
<link href="/_postgraphile/graphiql/static/css/main.63526d56.css" rel="stylesheet">
</head>
<body>
<div id="root"></div>
<script>window.POSTGRAPHILE_CONFIG={graphqlUrl:'/graphql',streamUrl:null}</script>
<script type="text/javascript" src="/_postgraphile/graphiql/static/js/main.878a1713.js"></script>
</body>
</html>Expected behavior:
Asset URLs have a leading period (.).
Expected page source:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>GraphiQL</title>
<meta name="robots" content="noindex" />
<link href="./_postgraphile/graphiql/static/css/main.63526d56.css" rel="stylesheet">
<!-- ^ dot added here -->
</head>
<body>
<div id="root"></div>
<script>window.POSTGRAPHILE_CONFIG = { graphqlUrl: './graphql', streamUrl: null }</script>
<!-- ^ dot added here -->
<script type="text/javascript" src="./_postgraphile/graphiql/static/js/main.878a1713.js"></script>
<!-- ^ dot added here -->
</body>
</html>cdaringe, Glogo, pepijnverburg, juliangruber and lgh06
Metadata
Metadata
Assignees
Labels
✋ release blockerprevents releasing the next versionprevents releasing the next version💅 enhancement