multiple ports
Browse files- .gitignore +1 -0
- Dockerfile +2 -2
- main.js +1 -1
- notes.txt +0 -12
- server.js +3 -3
.gitignore
CHANGED
@@ -11,6 +11,7 @@ node_modules
|
|
11 |
dist
|
12 |
dist-ssr
|
13 |
*.local
|
|
|
14 |
|
15 |
# Editor directories and files
|
16 |
.vscode/*
|
|
|
11 |
dist
|
12 |
dist-ssr
|
13 |
*.local
|
14 |
+
notes.txt
|
15 |
|
16 |
# Editor directories and files
|
17 |
.vscode/*
|
Dockerfile
CHANGED
@@ -15,5 +15,5 @@ RUN npm run build
|
|
15 |
ENV NODE_ENV production
|
16 |
# Expose the port on which the app will be running (3000 is the default that `serve` uses)
|
17 |
EXPOSE 7860
|
18 |
-
# Start the app
|
19 |
-
CMD [ "
|
|
|
15 |
ENV NODE_ENV production
|
16 |
# Expose the port on which the app will be running (3000 is the default that `serve` uses)
|
17 |
EXPOSE 7860
|
18 |
+
# Start the proxy and app
|
19 |
+
CMD ["bash", "-c", "node server.js & npx serve -l 7860 build"]
|
main.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import './style.css'
|
2 |
|
3 |
// Load environment variables
|
4 |
-
const portNum = process.env.PORT_NUM ||
|
5 |
|
6 |
// Get a reference to the elements
|
7 |
const imageUploader = document.getElementById("imageFileInput");
|
|
|
1 |
import './style.css'
|
2 |
|
3 |
// Load environment variables
|
4 |
+
const portNum = process.env.PORT_NUM || 3001;
|
5 |
|
6 |
// Get a reference to the elements
|
7 |
const imageUploader = document.getElementById("imageFileInput");
|
notes.txt
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
PS C:\COMMON\UPWORK\qwen_vl> npm init vite vite-prod
|
2 |
-
? Select a framework: » - Use arrow-keys. Return to submit.
|
3 |
-
√ Select a framework: » Vanilla
|
4 |
-
√ Select a variant: » JavaScript
|
5 |
-
|
6 |
-
Scaffolding project in C:\COMMON\UPWORK\qwen_vl\vite-prod...
|
7 |
-
|
8 |
-
Done. Now run:
|
9 |
-
|
10 |
-
cd vite-prod
|
11 |
-
npm install
|
12 |
-
npm run dev
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
server.js
CHANGED
@@ -3,7 +3,7 @@ import cors from 'cors';
|
|
3 |
import bodyParser from 'body-parser';
|
4 |
|
5 |
const app = express();
|
6 |
-
const port = process.env.PORT_NUM ||
|
7 |
const apiToken = process.env.REPLICATE_API_TOKEN;
|
8 |
const imgHostKey = process.env.IMAGE_HOST_KEY;
|
9 |
|
@@ -74,8 +74,8 @@ app.post('/imagehosting/upload', async (req, res) => {
|
|
74 |
}
|
75 |
});
|
76 |
|
77 |
-
// Serve your Vite project's static files
|
78 |
-
app.use(express.static('dist'));
|
79 |
|
80 |
// Start the server
|
81 |
app.listen(port, () => {
|
|
|
3 |
import bodyParser from 'body-parser';
|
4 |
|
5 |
const app = express();
|
6 |
+
const port = process.env.PORT_NUM || 3001;
|
7 |
const apiToken = process.env.REPLICATE_API_TOKEN;
|
8 |
const imgHostKey = process.env.IMAGE_HOST_KEY;
|
9 |
|
|
|
74 |
}
|
75 |
});
|
76 |
|
77 |
+
// Serve your Vite project's static files. Comment out to run app on a different port
|
78 |
+
//app.use(express.static('dist'));
|
79 |
|
80 |
// Start the server
|
81 |
app.listen(port, () => {
|