Serve flow page under 8093 path
This commit is contained in:
@@ -1958,8 +1958,9 @@ export default function App() {
|
|||||||
|
|
||||||
const openProgramWindow = (programId) => {
|
const openProgramWindow = (programId) => {
|
||||||
publishProgramStates(programStates);
|
publishProgramStates(programStates);
|
||||||
|
const appPath = window.location.pathname.startsWith('/8093') ? '/8093' : window.location.pathname || '/8093';
|
||||||
window.open(
|
window.open(
|
||||||
`/?view=program-detail&program=${encodeURIComponent(programId)}`,
|
`${appPath}?view=program-detail&program=${encodeURIComponent(programId)}`,
|
||||||
'program-detail-flow',
|
'program-detail-flow',
|
||||||
'popup=yes,width=620,height=990,left=80,top=40,resizable=yes,scrollbars=yes'
|
'popup=yes,width=620,height=990,left=80,top=40,resizable=yes,scrollbars=yes'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -117,6 +117,17 @@ function serverDatabasePlugin() {
|
|||||||
return {
|
return {
|
||||||
name: 'flow-server-sqlite-database',
|
name: 'flow-server-sqlite-database',
|
||||||
configureServer(server) {
|
configureServer(server) {
|
||||||
|
server.middlewares.use((request, response, next) => {
|
||||||
|
if (request.url === '/') {
|
||||||
|
response.statusCode = 302;
|
||||||
|
response.setHeader('Location', '/8093');
|
||||||
|
response.end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
|
||||||
server.middlewares.use('/api/state', async (request, response) => {
|
server.middlewares.use('/api/state', async (request, response) => {
|
||||||
try {
|
try {
|
||||||
if (request.method === 'GET') {
|
if (request.method === 'GET') {
|
||||||
|
|||||||
Reference in New Issue
Block a user