@bhooai/nexus-cli 2.0.6 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +1,44 @@
1
1
  import { defineConfig } from 'vite';
2
2
 
3
+ // Backend host the dev proxy targets. Override with NEXUS_BACKEND_HOST when
4
+ // deploying to a VPS (or running the backend on another machine). Defaults to
5
+ // localhost for local development.
6
+ const backendHost = process.env.NEXUS_BACKEND_HOST ?? 'localhost';
7
+
3
8
  export default defineConfig({
4
9
  server: {
5
10
  port: <%= adminPort %>,
6
11
  proxy: {
7
12
  '/admin': {
8
- target: 'http://localhost:<%= backendPort %>',
13
+ target: `http://${backendHost}:<%= backendPort %>`,
9
14
  changeOrigin: true,
10
15
  },
11
16
  '/ai': {
12
- target: 'http://localhost:<%= backendPort %>',
17
+ target: `http://${backendHost}:<%= backendPort %>`,
13
18
  changeOrigin: true,
14
19
  },
15
20
  '/api': {
16
- target: 'http://localhost:<%= backendPort %>',
21
+ target: `http://${backendHost}:<%= backendPort %>`,
17
22
  changeOrigin: true,
18
23
  },
19
24
  '/auth': {
20
- target: 'http://localhost:<%= backendPort %>',
25
+ target: `http://${backendHost}:<%= backendPort %>`,
21
26
  changeOrigin: true,
22
27
  },
23
28
  '/csrf-token': {
24
- target: 'http://localhost:<%= backendPort %>',
29
+ target: `http://${backendHost}:<%= backendPort %>`,
25
30
  changeOrigin: true,
26
31
  },
27
32
  '/health': {
28
- target: 'http://localhost:<%= backendPort %>',
33
+ target: `http://${backendHost}:<%= backendPort %>`,
29
34
  changeOrigin: true,
30
35
  },
31
36
  '/uploads': {
32
- target: 'http://localhost:<%= backendPort %>',
37
+ target: `http://${backendHost}:<%= backendPort %>`,
33
38
  changeOrigin: true,
34
39
  },
35
40
  '/ws': {
36
- target: 'ws://localhost:<%= backendPort %>',
41
+ target: `ws://${backendHost}:<%= backendPort %>`,
37
42
  ws: true,
38
43
  },
39
44
  },
@@ -6,7 +6,7 @@ Routes:
6
6
  POST /v1/chat/completions — chat completions (stream + non-stream) via Ollama
7
7
 
8
8
  Env:
9
- OLLAMA_BASE_URL Ollama server URL (default http://ollama:11434)
9
+ OLLAMA_BASE_URL Ollama server URL (default http://localhost:11434)
10
10
  OLLAMA_MODEL Default model if not specified in request (default llama3.2)
11
11
  """
12
12
  import json
@@ -18,7 +18,7 @@ from fastapi import FastAPI, Request
18
18
  from fastapi.middleware.cors import CORSMiddleware
19
19
  from fastapi.responses import JSONResponse, StreamingResponse
20
20
 
21
- OLLAMA_BASE_URL = os.getenv("OLLAMA_BASE_URL", "http://ollama:11434")
21
+ OLLAMA_BASE_URL = os.getenv("OLLAMA_BASE_URL", "http://localhost:11434")
22
22
  DEFAULT_MODEL = os.getenv("OLLAMA_MODEL", "llama3.2")
23
23
 
24
24
  app = FastAPI(title="<%= name %> AI server")
@@ -5,7 +5,7 @@ export default defineRoutes([
5
5
  method: 'GET',
6
6
  path: '/',
7
7
  handler: (ctx) => {
8
- ctx.json({ ok: true, name: '<%= nameSlug %>', docs: 'https://github.com/bhooai/nexus' });
8
+ ctx.json({ ok: true, name: '<%= nameSlug %>', docs: 'https://github.com/oravianando/BhooAI-Nexus' });
9
9
  },
10
10
  },
11
11
  ]);
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+
3
+ export function App() {
4
+ return (
5
+ <main style={{ fontFamily: 'system-ui', padding: '2rem' }}>
6
+ <h1>Welcome to <%= name %></h1>
7
+ <p>Your Nexus app is up. Edit <code>apps/frontend/src/App.tsx</code> to get started.</p>
8
+ </main>
9
+ );
10
+ }
@@ -1,16 +1,8 @@
1
1
  import React from 'react';
2
2
  import { createRoot } from 'react-dom/client';
3
-
4
- function App() {
5
- return (
6
- <main style={{ fontFamily: 'system-ui', padding: '2rem' }}>
7
- <h1>Welcome to <%= name %></h1>
8
- <p>Your Nexus app is up. Edit <code>apps/frontend/src/main.tsx</code> to get started.</p>
9
- </main>
10
- );
11
- }
3
+ import { App } from './App.js';
12
4
 
13
5
  const rootEl = document.getElementById('root');
14
6
  if (rootEl) {
15
7
  createRoot(rootEl).render(<App />);
16
- }
8
+ }
@@ -1,21 +1,26 @@
1
1
  import { defineConfig } from 'vite';
2
2
 
3
+ // Backend host the dev proxy targets. Override with NEXUS_BACKEND_HOST when
4
+ // deploying to a VPS (or running the backend on another machine). Defaults to
5
+ // localhost for local development.
6
+ const backendHost = process.env.NEXUS_BACKEND_HOST ?? 'localhost';
7
+
3
8
  export default defineConfig({
4
9
  server: {
5
10
  port: <%= frontendPort %>,
6
11
  proxy: {
7
12
  '/api': {
8
- target: 'http://localhost:<%= backendPort %>',
13
+ target: `http://${backendHost}:<%= backendPort %>`,
9
14
  changeOrigin: true,
10
15
  },
11
16
  '/uploads': {
12
- target: 'http://localhost:<%= backendPort %>',
17
+ target: `http://${backendHost}:<%= backendPort %>`,
13
18
  changeOrigin: true,
14
19
  },
15
20
  '/ws': {
16
- target: 'ws://localhost:<%= backendPort %>',
21
+ target: `ws://${backendHost}:<%= backendPort %>`,
17
22
  ws: true,
18
23
  },
19
24
  },
20
25
  },
21
- });
26
+ });