Skip to content
sgohl edited this page Dec 11, 2023 · 26 revisions

Setup new Project

  1. Create empty project folder; then fetch minimal/bare app skeleton
docker run --rm -v ${PWD}:/app ghcr.io/sgohl/wish:main bash -c 'cp -Rfv /www/app /app ; chmod -R 777 /app'
  1. Use this example compose.yml to begin
version: '2.4'

x-image: &IMAGE "ghcr.io/sgohl/wish:main"
x-appname: &APPNAME "myapp"
  
services:

  *APPNAME:
    container_name: *APPNAME
    stop_signal: "9"
    image: *IMAGE
    volumes:
      - ./app:/www/app
    ports:
      - "80:80"
      - "5000:5000"
    environment:
      APPNAME: "*APPNAME"
    #env_file:
      #- .env

Limitations

Headers

Currently, I don't see a nice and clean way to support multiple response headers (per page request), since HTTP excepts two empty new lines to terminate the headers from the body/response which prevents from providing a function to add an arbitrary number of headers because it won't know when no more headers come.

You may print your headers yourself and make sure that no body is written before your own two empty lines.

The only header that is set here is set-cookie within the Session function to let browser set the cookie after Login.

Namespaces

Of course, Bash does not provide namespaces by itself. There was a discussion about prefixing the app's functions with a name and some separator, but I like the simplicity of the current naming convention. However, nobody stops you from using a prefix in your app in case you might plan to have duplicate names that already exist.

TLDR; How it works

...

Clone this wiki locally