mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
- Add bin/omniroute.mjs CLI with banner, auto-open browser, graceful shutdown - Add scripts/prepublish.mjs to build Next.js standalone into app/ - Add .github/workflows/npm-publish.yml for automated publish on release - Update package.json: name=omniroute, bin, files, engines, keywords, prepublishOnly - Add output: 'standalone' to next.config.mjs - Add MIT LICENSE - Update .npmignore and .gitignore for app/ build artifact Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
60 lines
1.3 KiB
JavaScript
60 lines
1.3 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
output: "standalone",
|
|
transpilePackages: ["@omniroute/open-sse"],
|
|
allowedDevOrigins: ["192.168.*"],
|
|
images: {
|
|
unoptimized: true,
|
|
},
|
|
// NEXT_PUBLIC_CLOUD_URL is set in .env — do NOT hardcode here (it overrides .env)
|
|
webpack: (config, { isServer }) => {
|
|
// Ignore fs/path modules in browser bundle
|
|
if (!isServer) {
|
|
config.resolve.fallback = {
|
|
...config.resolve.fallback,
|
|
fs: false,
|
|
path: false,
|
|
};
|
|
}
|
|
return config;
|
|
},
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: "/chat/completions",
|
|
destination: "/api/v1/chat/completions",
|
|
},
|
|
{
|
|
source: "/responses",
|
|
destination: "/api/v1/responses",
|
|
},
|
|
{
|
|
source: "/models",
|
|
destination: "/api/v1/models",
|
|
},
|
|
{
|
|
source: "/v1/v1/:path*",
|
|
destination: "/api/v1/:path*",
|
|
},
|
|
{
|
|
source: "/v1/v1",
|
|
destination: "/api/v1",
|
|
},
|
|
{
|
|
source: "/codex/:path*",
|
|
destination: "/api/v1/responses",
|
|
},
|
|
{
|
|
source: "/v1/:path*",
|
|
destination: "/api/v1/:path*",
|
|
},
|
|
{
|
|
source: "/v1",
|
|
destination: "/api/v1",
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|