Move backend to backend dir

This commit is contained in:
aceberg 2025-09-05 06:10:16 +07:00
parent dee79fc74f
commit f1bb8166ba
44 changed files with 35 additions and 12 deletions

21
backend/LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 aceberg
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -7,13 +7,16 @@ mod:
run: run:
cd cmd/WatchYourLAN/ && \ cd cmd/WatchYourLAN/ && \
sudo \ sudo \
go run . #-c /data/config #-n http://192.168.2.3:8850 go run . #-n http://192.168.2.3:8850
fmt: fmt:
go fmt ./... go fmt ./...
lint: lint:
# golangci-lint run golangci-lint run
golint ./... golint ./...
check: fmt lint check: fmt lint
swag:
swag init --parseInternal --dir cmd/WatchYourLAN

View file

@ -13,13 +13,12 @@ func IsOpen(host, port string) bool {
target := fmt.Sprintf("%s:%s", host, port) target := fmt.Sprintf("%s:%s", host, port)
conn, err := net.DialTimeout("tcp", target, timeout) conn, err := net.DialTimeout("tcp", target, timeout)
if err != nil {
return false
}
if conn != nil { if err == nil {
conn.Close() err = conn.Close()
return true if err == nil {
return true
}
} }
return false return false

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -3,11 +3,11 @@ USR_NAME=aceberg
build: build:
npm run build && \ npm run build && \
rm ../internal/web/public/assets/* && \ rm ../backend/internal/web/public/assets/* && \
cp -r dist/assets ../internal/web/public cp -r dist/assets ../backend/internal/web/public
replace: replace:
cd ../internal/web/public/assets/ && \ cd ../backend/internal/web/public/assets/ && \
cat index.js | sed 's/assets/fs\/public\/assets/g;s/http:\/\/0.0.0.0:8840//' > tmp && \ cat index.js | sed 's/assets/fs\/public\/assets/g;s/http:\/\/0.0.0.0:8840//' > tmp && \
mv tmp index.js mv tmp index.js