finnsflask


Namefinnsflask JSON
Version 1.2 PyPI version JSON
download
home_pagehttps://github.com/the-real-finnventor/finnsflask
SummaryThis is a recreation of the popular python package, Flask.
upload_time2023-11-29 11:20:03
maintainer
docs_urlNone
authorReal Finnventor
requires_python
licenseMIT
keywords flask webserver jinja2
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # finnsflask

This is a recreation of the popular python package, Flask.

## Usage

### The base

For a project with no endpoints import the module then create a instance with:

```
app = finnsflask.FinnsFlask()
```

Then start the app with:

```
if __name__ == "__main__":
    app.listen()
```

### Endpoints

To declare an endpoint, between your app declaration and when you start the app, put:

```
@app.route('/<path>')
def index(request: finnsflask.HTTPRequest):
    return finnsflask.HTTPResponse("<h1>Real Finnventor is awesome</h1>", 200)
```

### Templates

finnsflask uses jinja2 as a templating system. To use a jinja2 template, use a route declaration like the following:

```
@app.route("/<path>")
def index(request: finnsflask.HTTPRequest):
    return finnsflask.HTTPResponse.load_template('<path-to-jinja2-template>', <template-args>)
```

### Cookies

To get a cookie, use the following inside of your route declaration:

```
cookies = request.getCookies()
```

To set a cookie, use a route declaration like the following:

```
@app.route("/<path>")
def index(request: finnsflask.HTTPRequest):
    response = finnsflask.HTTPResponse()
    response.setCookie("<key>", "<value>")
    return response
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/the-real-finnventor/finnsflask",
    "name": "finnsflask",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "FLASK,WEBSERVER,JINJA2",
    "author": "Real Finnventor",
    "author_email": "finnventor@everspaugh.com",
    "download_url": "https://github.com/the-real-finnventor/finnsflask/archive/refs/tags/1.2.tar.gz",
    "platform": null,
    "description": "# finnsflask\n\nThis is a recreation of the popular python package, Flask.\n\n## Usage\n\n### The base\n\nFor a project with no endpoints import the module then create a instance with:\n\n```\napp = finnsflask.FinnsFlask()\n```\n\nThen start the app with:\n\n```\nif __name__ == \"__main__\":\n    app.listen()\n```\n\n### Endpoints\n\nTo declare an endpoint, between your app declaration and when you start the app, put:\n\n```\n@app.route('/<path>')\ndef index(request: finnsflask.HTTPRequest):\n    return finnsflask.HTTPResponse(\"<h1>Real Finnventor is awesome</h1>\", 200)\n```\n\n### Templates\n\nfinnsflask uses jinja2 as a templating system. To use a jinja2 template, use a route declaration like the following:\n\n```\n@app.route(\"/<path>\")\ndef index(request: finnsflask.HTTPRequest):\n    return finnsflask.HTTPResponse.load_template('<path-to-jinja2-template>', <template-args>)\n```\n\n### Cookies\n\nTo get a cookie, use the following inside of your route declaration:\n\n```\ncookies = request.getCookies()\n```\n\nTo set a cookie, use a route declaration like the following:\n\n```\n@app.route(\"/<path>\")\ndef index(request: finnsflask.HTTPRequest):\n    response = finnsflask.HTTPResponse()\n    response.setCookie(\"<key>\", \"<value>\")\n    return response\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "This is a recreation of the popular python package, Flask.",
    "version": "1.2",
    "project_urls": {
        "Download": "https://github.com/the-real-finnventor/finnsflask/archive/refs/tags/1.2.tar.gz",
        "Homepage": "https://github.com/the-real-finnventor/finnsflask"
    },
    "split_keywords": [
        "flask",
        "webserver",
        "jinja2"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a4cd97dc127f7a84212724ee5d438fdbd2e8fac66474c9112f807aac83374f1",
                "md5": "dd604b771d378d196005854d6ce30a41",
                "sha256": "ff1d2b37a5f4283dfd95299863b3c92090d4fae23d90ba673a8301c521b13781"
            },
            "downloads": -1,
            "filename": "finnsflask-1.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dd604b771d378d196005854d6ce30a41",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 4708,
            "upload_time": "2023-11-29T11:20:03",
            "upload_time_iso_8601": "2023-11-29T11:20:03.076619Z",
            "url": "https://files.pythonhosted.org/packages/6a/4c/d97dc127f7a84212724ee5d438fdbd2e8fac66474c9112f807aac83374f1/finnsflask-1.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-29 11:20:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "the-real-finnventor",
    "github_project": "finnsflask",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "finnsflask"
}
        
Elapsed time: 0.15029s