0.27.1 • Published 3 months ago

@teqfw/web v0.27.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

@teqfw/web

Disclaimer

This package is a part of the Tequila Framework (TeqFW). The TeqFW is currently in an early stage of development and should be considered unstable. It may change rapidly, leading to breaking changes without prior notice. Use it at your own risk. Please note that contributions to the project are welcome, but they should only be made by those who understand and accept the risks of working with an unstable framework.

Overview

This teq-plugin adds basic web server functionality to Tequila Framework based projects.

  • console commands to start/stop web server in HTTP/1.1, HTTP/2, HTTPS modes;
  • basic web requests processing with possibility to add various handlers;
  • requests handlers:
    • TeqFw_Web_Back_App_Server_Handler_Final: unprocessed requests responder;
    • TeqFw_Web_Back_App_Server_Handler_Static: GET requests for static resources;
    • TeqFw_Web_Back_App_Server_Handler_Config: GET requests to load various frontend configurations;

TODO

  • move the IndexedDB functionality to some external plugin (@teqfw/front-idb?)

Namespace

This plugin uses TeqFw_Web namespace.

Install

$ npm i @teqfw/web --save 

Namespace

This plugin uses TeqFw_Web namespace.

CLI commands

$ node ./bin/tequila.mjs help
Usage: tequila [options] [command]
...
Commands:
  web-server-start [options]  Start web server.
  web-server-stop             Stop web server.
$ node ./bin/tequila.mjs help web-server-start
... 
Options:
  -c, --cert <path>  certificates chain in PEM format to secure HTTP/2 server
  -1, --http1        use HTTP/1 server (default: HTTP/2)
  -k, --key <path>   private key in PEM format to secure HTTP/2 server
  -p, --port <port>  port to use (default: 8080)
  -s, --skipPid      don't save PID file (used for read-only filesystems like Google AppEngine)
  -w, --useWs        use web sockets with this server
  -h, --help         display help for command

./cfg/local.json

DTO for @teqfw/web node.

{
  "@teqfw/web": {
    "server": {
      "port": 8080,
      "secure": {
        "cert": "/path/to/cert.pem",
        "key": "/path/to/key.pem"
      },
      "useHttp1": false
    },
    "urlBase": "domain.com"
  }
}

teqfw.json

DTO for @teqfw/web nodes in teq-plugins descriptors.

{
  "@teqfw/web": {
    "doors": ["admin", "pub"],
    "excludes": {
      "handlers": ["Ns_Mod"]
    },
    "handlers": {
      "Ns_Mod": {
        "after": ["Ns_Mod"],
        "before": ["Ns_Mod"],
        "spaces": ["custom"]
      }
    },
    "statics": {
      "/url-path/": "/filesystem-path/"
    }
  }
}
0.27.1

3 months ago

0.27.0

4 months ago

0.26.0

5 months ago

0.25.0

7 months ago

0.24.2

9 months ago

0.24.1

10 months ago

0.24.0

10 months ago

0.23.0

1 year ago

0.22.0

1 year ago

0.21.0

1 year ago

0.20.1

2 years ago

0.20.0

2 years ago

0.20.2

2 years ago

0.10.0

2 years ago

0.11.0

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.2

2 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago