Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4f4e98b
feat: remove old file
tuanngocptn Dec 20, 2024
1b98029
feat: init client and server
tuanngocptn Dec 20, 2024
6176f21
feat: finish config docker compose
tuanngocptn Dec 20, 2024
86db570
refactor: change for running with dockercompose
tuanngocptn Dec 23, 2024
c934367
feat: change network config
tuanngocptn Dec 23, 2024
39293cf
feat: disable nginx log
tuanngocptn Dec 23, 2024
244e5eb
chore: refactor environment configuration and enhance docker setup
tuanngocptn Dec 25, 2024
d33726d
chore: draft
tuanngocptn Dec 25, 2024
cde3c16
feat: finish editing
tuanngocptn Dec 25, 2024
fa68325
refactor: streamline socket handling and request processing in client…
tuanngocptn Dec 25, 2024
89f8a88
refactor: enhance socket connection handling and improve request proc…
tuanngocptn Dec 25, 2024
adb01a5
chore: update dependencies and refactor domain validation
tuanngocptn Dec 25, 2024
630c22c
feat: implement website structure and enhance build process
tuanngocptn Dec 25, 2024
fc3c7e2
feat: add initial website assets and structure for NPort
tuanngocptn Dec 26, 2024
8ddeed4
feat: add complete website structure and assets for NPort
tuanngocptn Dec 26, 2024
006c28d
feat: restructure website with Jekyll and enhance Docker setup
tuanngocptn Jan 2, 2025
3165985
refactor: remove obsolete configuration and assets, streamline Docker…
tuanngocptn Jan 2, 2025
0d53a68
feat: complete overhaul of NPort website structure and assets
tuanngocptn Jan 2, 2025
fcd1319
chore: remove obsolete client and server files, streamline project st…
tuanngocptn Jan 2, 2025
2a192ba
feat: add Babel configuration and update dependencies for improved bu…
tuanngocptn Jan 2, 2025
63cd4a0
feat: implement client-server architecture and enhance website struct…
tuanngocptn Jan 2, 2025
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
15 changes: 0 additions & 15 deletions Dockerfile

This file was deleted.

22 changes: 22 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "12"
}
}
]
],
"plugins": [
[
"replace-import-extension",
{
"extMapping": {
".mjs": ".js"
}
}
]
]
}
43 changes: 0 additions & 43 deletions bin/client

This file was deleted.

28 changes: 0 additions & 28 deletions bin/server

This file was deleted.

69 changes: 0 additions & 69 deletions client.js

This file was deleted.

1 change: 1 addition & 0 deletions config/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SERVER_URL=https://server.nport.link
2 changes: 2 additions & 0 deletions config/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SERVER_URL=http://server.nport.local
DOMAIN=nport.local
7 changes: 7 additions & 0 deletions config/client.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:22.12.0-slim
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
ENTRYPOINT ["npm", "run", "client"]
22 changes: 22 additions & 0 deletions config/nport.local.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# nginx for running nport locally you need edit host file for add
# 127.0.0.1 nport.local
# 127.0.0.1 server.nport.local
# 127.0.0.1 myapp.nport.local

server {
listen 80;
listen [::]:80;
server_name localhost, nport.local *.nport.local;
location / {
proxy_pass http://nport-server:3000/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_redirect off;
}
}
7 changes: 7 additions & 0 deletions config/server.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:22.12.0-slim
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
ENTRYPOINT ["npm", "run", "server"]
27 changes: 27 additions & 0 deletions dist/client/client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env node
"use strict";

var _yargs = _interopRequireDefault(require("yargs"));
var _helpers = require("yargs/helpers");
var _clientService = _interopRequireDefault(require("./services/client.service.js"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
(0, _yargs.default)((0, _helpers.hideBin)(process.argv)).command("* [hostname]:[port] [subdomain]", "Start the client", yargs => {
yargs.positional("port", {
type: "number",
default: 4000,
describe: "The port to start the server on"
});
yargs.positional("subdomain", {
type: "string",
default: "myapp",
describe: "The subdomain to use"
});
yargs.positional("hostname", {
type: "string",
default: "192.168.10.5",
describe: "Address of local server for forwarding over NPort"
});
}, options => (0, _clientService.default)({
...options,
server: process.env.SERVER_URL
})).parse();
Loading