Spaces:
Running
Running
Upload ALKABRAIN AI companion
Browse filesWarm Claude.ai-style AI companion routing to 20+ open-source HF models, with Replit Auth, Postgres, Razorpay billing, chat history, and strict help bot.
artifacts/api-server/src/app.ts
CHANGED
|
@@ -41,7 +41,7 @@ const STATIC_DIR =
|
|
| 41 |
process.env.STATIC_DIR ?? path.resolve(process.cwd(), "public");
|
| 42 |
if (fs.existsSync(STATIC_DIR)) {
|
| 43 |
app.use(express.static(STATIC_DIR, { index: false, maxAge: "1h" }));
|
| 44 |
-
app.get(
|
| 45 |
if (req.path.startsWith("/api/")) return next();
|
| 46 |
const indexPath = path.join(STATIC_DIR, "index.html");
|
| 47 |
if (fs.existsSync(indexPath)) {
|
|
|
|
| 41 |
process.env.STATIC_DIR ?? path.resolve(process.cwd(), "public");
|
| 42 |
if (fs.existsSync(STATIC_DIR)) {
|
| 43 |
app.use(express.static(STATIC_DIR, { index: false, maxAge: "1h" }));
|
| 44 |
+
app.get(/^\/(?!api\/).*/, (req: Request, res: Response, next) => {
|
| 45 |
if (req.path.startsWith("/api/")) return next();
|
| 46 |
const indexPath = path.join(STATIC_DIR, "index.html");
|
| 47 |
if (fs.existsSync(indexPath)) {
|