Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract PORT argument for nodejs examples #1279

Merged
merged 1 commit into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/nodejs-custom-file-path/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const fs = require('fs');
const Upscaler = require('upscaler/node');
const tf = require('@tensorflow/tfjs-node');

const PORT = 8080;

const app = express();

const upscaler = new Upscaler({
Expand Down Expand Up @@ -34,5 +36,5 @@ const getUpscaledImage = async () => {
return upscaledTensor;
}

app.listen(8080);
console.log('Running on http://localhost:8080/');
app.listen(PORT);
console.log(`Running on http://localhost:${PORT}/`);
6 changes: 4 additions & 2 deletions examples/nodejs-model/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const Upscaler = require('upscaler/node');
const x2 = require('@upscalerjs/esrgan-thick/2x');
const tf = require('@tensorflow/tfjs-node');

const PORT = 8080;

const app = express();

const upscaler = new Upscaler({
Expand Down Expand Up @@ -33,5 +35,5 @@ const getUpscaledImage = async () => {
return upscaledTensor;
}

app.listen(8080);
console.log('Running on http://localhost:8080/');
app.listen(PORT);
console.log(`Running on http://localhost:${PORT}/`);
6 changes: 4 additions & 2 deletions examples/nodejs/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const fs = require('fs');
const Upscaler = require('upscaler/node');
const tf = require('@tensorflow/tfjs-node');

const PORT = 8080;

const app = express();

const upscaler = new Upscaler();
Expand All @@ -28,5 +30,5 @@ const getUpscaledImage = async () => {
return upscaledTensor;
}

app.listen(8080);
console.log('Running on http://localhost:8080/');
app.listen(PORT);
console.log(`Running on http://localhost:${PORT}/`);
Loading