Skip to content
sgohl edited this page Jan 10, 2024 · 26 revisions

Create new App

  1. Scaffold 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"
    environment:
      APPNAME: "*APPNAME"
    #env_file:
      #- .env
  1. start container
docker compose up -d

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 so you may never collide with the main app or another app or plug.

Clone this wiki locally