def s_add(self, path, function, method=None, type_cast=None):
with self._lock:<EOL><INDENT>try:<EOL><INDENT>path = '<STR_LIT>'.format(path.lstrip('<STR_LIT:/>'))<EOL>path = '<STR_LIT>'.format(path.rstrip('<STR_LIT:/>'))<EOL>path = path.replace('<STR_LIT:<>', '<STR_LIT>')<EOL>path = path.replace('<STR_LIT:>>', '<STR_LIT>')<EOL>self.add(path, function, method, type_cast)<EOL><DEDENT>except Exception:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>
Function for registering a simple path.

        Args:
            path (str): Path to be matched.
            function (function): Function to associate with this path.
            method (str, optional): Usually used to define one of GET, POST,
                PUT, DELETE. You may use whatever fits your situation though.
                Defaults to None.
            type_cast (dict, optional): Mapping between the param name and
                one of `int`, `float` or `bool`. The value reflected by the
                provided param name will than be casted to the given type.
                Defaults to None.