Skip to content
Snippets Groups Projects
Verified Commit b9cd4bb0 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: commit save point

parent d0ec8b66
No related branches found
No related tags found
No related merge requests found
Showing with 195 additions and 28 deletions
......@@ -41,7 +41,7 @@ include $(MAKEFILE_IMPORT_PATH)directories-standard.mk
#include $(MAKEFILE_IMPORT_PATH)jsdoc.mk
include $(MAKEFILE_IMPORT_PATH)output.mk
include $(MAKEFILE_IMPORT_PATH)placeholder.mk
#include $(MAKEFILE_IMPORT_PATH)s3.mk
include $(MAKEFILE_IMPORT_PATH)s3.mk
#include $(MAKEFILE_IMPORT_PATH)license-agpl3.mk
#include $(MAKEFILE_IMPORT_PATH)jsdoc-json.mk
include $(MAKEFILE_IMPORT_PATH)go.mk
......
# A small, self-contained, cross-platform web server for development
This tool helps to serve files.
## Install
Conan is a binary file that must be stored in a directory.
The files can be found [here](http://download.schukai.com/tools/conan/).
```bash
wget -O ~/.local/bin/conan http://download.schukai.com/tools/conan/conan-linux-amd64
## For Linux, the execution bit must still be set.
chmod u+x ~/.local/bin/conan
```
## Commands
### General Parameters
#### Configuration
```yaml
Server:
# The hostname or IP address of the server (CONAN_SERVER_HOST)
# Domain, IP or hostname of the server
# Host: localhost:8080
# The port of the server (CONAN_SERVER_ADDRESS)
# Address: localhost
# The port of the server (CONAN_SERVER_PORT)
# Port: 8080
#
Path:
# The path to the server (CONAN_SERVER_WEB_PATH)
Web: web
Watch:
- Path: src
Command: /bin/bash -c "npx esbuild --bundle --outfile={{ .WebPath }}/scripts/bundle.js --sourcemap {{ .Path }}"
Exclude:
- ~$
- ^\.
- Path: web
Exclude:
- ~$
- ^\.
Flags:
FollowSymlinks: true
```
### Server
Start server and deliver files.
```bash
conan server serve
```
Start with configuration file.
```bash
conan server start --config config.yaml
```
### Help
There is help on the command line for each individual command.
```bash
conan --help
```
## Change Log
- Version 1.0
- Initial release
## License # Credits
- Icons Font Face - https://fontawesome.com/
- Bootstrap 5 - http://getbootstrap.com/
package command
import (
"fmt"
"gitlab.schukai.com/oss/utilities/conan/configuration"
"gitlab.schukai.com/oss/utilities/conan/logging"
"gitlab.schukai.com/oss/utilities/conan/server"
"os"
"path"
)
type ServerServeCommand struct {
Port string `long:"port" short:"p" description:"Port to listen on"`
Address string `long:"address" short:"a" description:"Address to serve on"`
WebPath string `long:"web-path" short:"e" description:"Path to web files"`
WatchPath string `long:"watch-path" short:"w" description:"Path to watch for changes"`
Exclude string `long:"exclude" short:"x" description:"Exclude pattern"`
Port string `long:"port" short:"p" description:"Port to listen on"`
Address string `long:"address" short:"a" description:"Address to serve on"`
WebPath string `long:"web-path" short:"e" description:"Path to web files"`
WatchPath string `long:"watch-path" short:"w" description:"Path to watch for changes"`
Exclude []string `long:"exclude" short:"x" description:"Exclude pattern"`
}
func (r *ServerServeCommand) execute() {
logging.InitLogger()
configuration.SetServerPort(r.Port)
configuration.SetServerAddress(r.Address)
configuration.SetServerWebPath(r.WebPath)
fmt.Printf("Serving on %s:%s\n", r.WatchPath, r.Exclude)
var w string
if r.WatchPath != "" {
w = r.WatchPath
if !path.IsAbs(w) {
wd, err := os.Getwd()
if err != nil {
logging.LogError("ServerServeCommand error %s", err.Error())
return
}
w = path.Join(wd, w)
}
configuration.AddWatch(configuration.Watch{
Path: r.WatchPath,
Exclude: []string{
r.Exclude,
},
Path: w,
Exclude: r.Exclude,
})
}
logging.InitLogger()
server.Start()
}
......@@ -25,7 +25,7 @@ func injectHandler(next http.Handler) http.Handler {
p, err := os.ReadFile(path)
if err != nil {
logging.LogError("injectHandler error %s", err.Error())
logging.LogError("InjectHandler error %s", err.Error())
return
}
......
......@@ -57,7 +57,7 @@ func SendReloadMessage() {
return
}
time.AfterFunc(time.Second*2, doReload)
time.AfterFunc(time.Second, doReload)
logging.LogInfo("timer ...")
waitForReload = true
......
This diff is collapsed.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="index.css" rel="stylesheet">
<style>
body {
background-color: #ffffff;
}
</style>
<title>Download Portal schukai GmbH</title>
</head>
<body>
<div class="d-flex flex-column align-items-center justify-content-center"
style="height:100vh;">
<div class="text-center">
<a href="https://www.schukai.com" class="text-decoration-none text-white text-decoration"><img
src="https://cdn.alvine.io/image/logo/schukai-rot.svg" width="300px"></a>
<br>
<div class="card mt-5">
<div class="card-header">
Conan
</div>
<ul class="list-group">
<li class="list-group-item"><a class="text-decoration-none link-danger" href="./conan-linux-386">conan-linux-386</a>
</li>
<li class="list-group-item"><a class="text-decoration-none link-danger" href="./conan-linux-amd64">conan-linux-amd64</a>
</li>
<li class="list-group-item"><a class="text-decoration-none link-danger" href="./conan-linux-arm">conan-linux-arm</a>
</li>
<li class="list-group-item"><a class="text-decoration-none link-danger" href="./conan-linux-arm64">conan-linux-arm64</a>
</li>
<li class="list-group-item"><a class="text-decoration-none link-danger" href="./conan-windows">conan-windows</a>
</li>
</ul>
</div>
<p class="mt-5">
<a href="https://about.schukai.com/de/impressum/" class="text-decoration-none text-decoration"
style="color:#c10000">Imprint</a></p>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
This diff is collapsed.
......@@ -18,7 +18,7 @@ Server:
Watch:
- Path: src
Command: /bin/bash -c "PATH=$PATH:/home/volker.schukai/.nvm/versions/node/v18.8.0/bin; npx esbuild --bundle --outfile={{ .WebPath }}/scripts/bundle.js --sourcemap {{ .Path }}"
Command: /bin/bash -c "npx esbuild --bundle --outfile={{ .WebPath }}/scripts/bundle.js --sourcemap {{ .Path }}"
Exclude:
- ~$
- ^\.
......
document.addEventListener("DOMContentLoaded", () => {
document.querySelector("#app").innerHTML = "Hello!!! World?!";
let text="how are you doing?"
document.querySelector("#app").innerHTML = text;
})
// Language: javascript
\ No newline at end of file
// Language: javascript
......@@ -6,10 +6,6 @@
<script src="scripts/bundle.js"></script>
</head>
<body>
<h1>Hello ...ddd</h1>
<div id="app"></div>
<h1>Hello Developer!?</h1>
<div id="app"></div>
</body>
1
1
1
1
(() => {
// src/main.js
document.addEventListener("DOMContentLoaded", () => {
document.querySelector("#app").innerHTML = "Hello!!! World?!";
let text = "how are you doing?";
document.querySelector("#app").innerHTML = text;
});
})();
//# sourceMappingURL=bundle.js.map
{
"version": 3,
"sources": ["../../src/main.js"],
"sourcesContent": ["document.addEventListener(\"DOMContentLoaded\", () => {\n document.querySelector(\"#app\").innerHTML = \"Hello!!! World?!\";\n})\n// Language: javascript "],
"mappings": ";;AAAA,WAAS,iBAAiB,oBAAoB,MAAM;AAChD,aAAS,cAAc,MAAM,EAAE,YAAY;AAAA,EAC/C,CAAC;",
"sourcesContent": ["document.addEventListener(\"DOMContentLoaded\", () => {\n let text=\"how are you doing?\"\n document.querySelector(\"#app\").innerHTML = text;\n})\n// Language: javascript \n"],
"mappings": ";;AAAA,WAAS,iBAAiB,oBAAoB,MAAM;AAChD,QAAI,OAAK;AACT,aAAS,cAAc,MAAM,EAAE,YAAY;AAAA,EAC/C,CAAC;",
"names": []
}
......@@ -17,4 +17,6 @@ deploy: compile
.PHONY: overview-to-s3
## overview-to-s3
overview-to-s3:
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.html $(UPLOAD_TOOL_URL)
\ No newline at end of file
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.html $(UPLOAD_TOOL_URL)
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.css $(UPLOAD_TOOL_URL)
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.js $(UPLOAD_TOOL_URL)
\ No newline at end of file
{"version":"0.1.29"}
{"version":"0.1.36"}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment