mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 05:23:04 +00:00
6589cbbd0d
* ui: Add the most basic workspace root in /ui * We already have a LICENSE file in the repository root * Change directory path in build scripts ui-v2 -> ui * Make yarn install flags configurable from elsewhere * Minimal workspace root makefile * Call the new docker specific target * Update yarn in the docker build image * Reconfigure the netlify target and move to the higher makefile * Move ui-v2 -> ui/packages/consul-ui * Change repo root to refleect new folder structure * Temporarily don't hoist consul-api-double * Fixup CI configuration * Fixup lint errors * Fixup Netlify target
30 lines
988 B
JavaScript
30 lines
988 B
JavaScript
'use strict';
|
|
const fs = require('fs');
|
|
const promisify = require('util').promisify;
|
|
const read = promisify(fs.readFile);
|
|
const express = require('express');
|
|
|
|
module.exports = function(app, options) {
|
|
// During development the proxy server has no way of
|
|
// knowing the content/mime type of our `oidc/callback` file
|
|
// as it has no extension.
|
|
// This shims the default server to set the correct headers
|
|
// just for this file
|
|
|
|
const file = `/oidc/callback`;
|
|
const rootURL = options.rootURL;
|
|
const url = `${rootURL.substr(0, rootURL.length - 1)}${file}`;
|
|
app.use(function(req, resp, next) {
|
|
if (req.url.split('?')[0] === url) {
|
|
return read(`${process.cwd()}/public${file}`).then(function(buffer) {
|
|
resp.header('Content-Type', 'text/html');
|
|
resp.write(buffer.toString());
|
|
resp.end();
|
|
});
|
|
}
|
|
next();
|
|
});
|
|
// Serve the coverage folder for easy viewing during development
|
|
app.use('/coverage', express.static('coverage'));
|
|
};
|