mirror of
https://github.com/documenso/documenso.git
synced 2025-11-20 03:32:14 +10:00
fix: build
This commit is contained in:
24
apps/remix/server/main.js
Normal file
24
apps/remix/server/main.js
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* This is the main entry point for the server which will launch the RR7 application
|
||||
* and spin up auth, api, etc.
|
||||
*
|
||||
* Note:
|
||||
* This file will be copied to the build folder during build time.
|
||||
* Running this file will not work without a build.
|
||||
*/
|
||||
import { serve } from '@hono/node-server';
|
||||
import { serveStatic } from '@hono/node-server/serve-static';
|
||||
import handle from 'hono-react-router-adapter/node';
|
||||
|
||||
import server from './hono/server/router.js';
|
||||
import * as build from './index.js';
|
||||
|
||||
server.use(
|
||||
serveStatic({
|
||||
root: 'build/client',
|
||||
}),
|
||||
);
|
||||
|
||||
const handler = handle(build, server);
|
||||
|
||||
serve({ fetch: handler.fetch, port: 3000 });
|
||||
@ -1,17 +0,0 @@
|
||||
// main.ts
|
||||
import { serve } from '@hono/node-server';
|
||||
import { serveStatic } from '@hono/node-server/serve-static';
|
||||
import handle from 'hono-react-router-adapter/node';
|
||||
|
||||
import server from '.';
|
||||
import * as build from '../build/server';
|
||||
|
||||
server.use(
|
||||
serveStatic({
|
||||
root: './build/client',
|
||||
}),
|
||||
);
|
||||
|
||||
const handler = handle(build, server);
|
||||
|
||||
serve({ fetch: handler.fetch, port: 3000 });
|
||||
@ -72,8 +72,12 @@ app
|
||||
throw new AppError('INVALID_DOCUMENT_FILE');
|
||||
}
|
||||
|
||||
// Todo: Test this.
|
||||
if (!file.name.endsWith('.pdf')) {
|
||||
file.name = `${file.name}.pdf`;
|
||||
Object.defineProperty(file, 'name', {
|
||||
writable: true,
|
||||
value: `${file.name}.pdf`,
|
||||
});
|
||||
}
|
||||
|
||||
const { type, data } = await putFile(file);
|
||||
@ -1,7 +1,7 @@
|
||||
import { getContext } from 'hono/context-storage';
|
||||
import { redirect } from 'react-router';
|
||||
import type { HonoEnv } from 'server';
|
||||
import type { AppContext } from 'server/context';
|
||||
import type { HonoEnv } from 'server/router';
|
||||
|
||||
import type { AppSession } from '@documenso/lib/client-only/providers/session';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user