NaviServer - programmable web server
4.99  5.0

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_register_cgi(n) 5.0.0a nscgi "nscgi Built-in Commands"

Name

ns_register_cgi - Register CGI handlers

Table Of Contents

Synopsis

Description

This document describes how to register a CGI handler programmatically.

COMMANDS

ns_register_cgi ?-noinherit? ?-matchsegments? ?-path source-location? ?--? method URL

The command registers a handler requests matching method and URL to be handled as CGI programs. The specified URL can contain a match pattern, which is handled by the NaviServer urlspace (like in ns_register_proc). The match will always be a match on the last URL segment, unless -matchsegments is specified.

If -noinherit is specified, the request URL must match the directory of the registered URL.

If -matchsegments is specified, the pattern will be matched with all segments of the request URL.

The -path specifies the source location for the files in case the request URL matches the register URL. The provided source location is registered via ns_register_fasturl2file such that fastpath can resolve the request path against this source location.

Handlers registered with ns_register_cgi can be unregistered via ns_unregister_op. In case the -path was specified, it can be unregistered with ns_unregister_url2file.

See Also

ns_register, ns_register_fasturl2file, ns_unregister_op

Keywords

CGI, callback, fastpath, handler, nscgi, request, urlspace