{"html_url": "https://github.com/simonw/datasette/issues/160#issuecomment-459915995", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/160", "id": 459915995, "node_id": "MDEyOklzc3VlQ29tbWVudDQ1OTkxNTk5NQ==", "user": {"value": 82988, "label": "psychemedia"}, "created_at": "2019-02-02T00:43:16Z", "updated_at": "2019-02-02T00:58:20Z", "author_association": "CONTRIBUTOR", "body": "Do you have any simple working examples of how to use `--static`? Inspection of default served files suggests locations such as `http://example.com/-/static/app.css?0e06ee`.\r\n\r\nIf `datasette` is being proxied to `http://example.com/foo/datasette`, what form should arguments to `--static` take so that static files are correctly referenced?\r\n\r\nUse case is here: https://github.com/psychemedia/jupyterserverproxy-datasette-demo Trying to do a really simple `datasette` demo in MyBinder using jupyter-server-proxy.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 278208011, "label": "Ability to bundle and serve additional static files"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/160#issuecomment-350496258", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/160", "id": 350496258, "node_id": "MDEyOklzc3VlQ29tbWVudDM1MDQ5NjI1OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-12-09T18:29:28Z", "updated_at": "2017-12-09T18:29:28Z", "author_association": "OWNER", "body": "Example usage:\r\n\r\n datasette package --static css:extra-css/ --static js:extra-js/ \\\r\n \tsf-trees.db --template-dir templates/ --tag sf-trees --branch master\r\n\r\nThis creates a local Docker image that includes copies of the templates/,\r\nextra-css/ and extra-js/ directories. You can then run it like this:\r\n\r\n\tdocker run -p 8001:8001 sf-trees\r\n\r\nFor publishing to Zeit now:\r\n\r\n\tdatasette publish now --static css:extra-css/ --static js:extra-js/ \\\r\n\t\tsf-trees.db --template-dir templates/ --name sf-trees --branch master\r\n\r\nExample: https://sf-trees-wbihszoazc.now.sh/sf-trees-02c8ef1/Street_Tree_List\r\n\r\nFor publishing to Heroku:\r\n\r\n\tdatasette publish heroku --static css:extra-css/ --static js:extra-js/ \\\r\n\t\tsf-trees.db --template-dir templates/ --branch master\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 278208011, "label": "Ability to bundle and serve additional static files"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/160#issuecomment-348793156", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/160", "id": 348793156, "node_id": "MDEyOklzc3VlQ29tbWVudDM0ODc5MzE1Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-12-03T16:35:53Z", "updated_at": "2017-12-03T16:35:53Z", "author_association": "OWNER", "body": "Still TODO: teach `datasette publish` and friends about this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 278208011, "label": "Ability to bundle and serve additional static files"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/160#issuecomment-348793054", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/160", "id": 348793054, "node_id": "MDEyOklzc3VlQ29tbWVudDM0ODc5MzA1NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-12-03T16:35:22Z", "updated_at": "2017-12-03T16:35:22Z", "author_association": "OWNER", "body": "You can now tell Datasette to serve static files from a specific location at a\r\nspecific mountpoint.\r\n\r\nFor example:\r\n\r\n\tdatasette serve mydb.db --static extra-css:/tmp/static/css\r\n\r\nNow if you visit this URL:\r\n\r\n\thttp://localhost:8001/extra-css/blah.css\r\n\r\nThe following file will be served:\r\n\r\n\t/tmp/static/css/blah.css\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 278208011, "label": "Ability to bundle and serve additional static files"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/160#issuecomment-348719827", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/160", "id": 348719827, "node_id": "MDEyOklzc3VlQ29tbWVudDM0ODcxOTgyNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-12-02T21:01:36Z", "updated_at": "2017-12-02T21:01:36Z", "author_association": "OWNER", "body": "`-m` is already taken for `--metadata`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 278208011, "label": "Ability to bundle and serve additional static files"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/160#issuecomment-348719752", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/160", "id": 348719752, "node_id": "MDEyOklzc3VlQ29tbWVudDM0ODcxOTc1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-12-02T21:00:21Z", "updated_at": "2017-12-02T21:00:21Z", "author_association": "OWNER", "body": "Not sure which I like better out of `-d/--docroot` or `-s/--static` or `-m/--mount` for this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 278208011, "label": "Ability to bundle and serve additional static files"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/160#issuecomment-348719680", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/160", "id": 348719680, "node_id": "MDEyOklzc3VlQ29tbWVudDM0ODcxOTY4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-12-02T20:59:27Z", "updated_at": "2017-12-02T20:59:27Z", "author_association": "OWNER", "body": "This is about more than just CSS and JavaScript - there are plenty of reasons someone might want to bundle HTML as well, e.g. for building something like https://sf-tree-search.now.sh/\r\n\r\nSo, instead of thinking about this in terms of /static/, I'm going to think about this in terms of allowing people to mount one or more document roots (or docroots).\r\n\r\n datasette serve mydb.db -d my-doc-root/\r\n\r\nThis will cause the root of the server to show content from the `my-doc-root/` directory (assuming it has an index.html file in it).\r\n\r\nA more common option will be to mount specific folders to specific directories, like this:\r\n\r\n datasette serve mydb.db -d static:my-static/\r\n\r\nNow any hits to `/static/foo.css` will serve content from `my-static/foo.css`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 278208011, "label": "Ability to bundle and serve additional static files"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/160#issuecomment-348404864", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/160", "id": 348404864, "node_id": "MDEyOklzc3VlQ29tbWVudDM0ODQwNDg2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-12-01T05:26:57Z", "updated_at": "2017-12-01T05:26:57Z", "author_association": "OWNER", "body": "Question is... what should happen to the default static stuff? At the moment that's just https://fivethirtyeight.datasettes.com/-/static/app.css - though I want to improve that to include a content hash, see #154 ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 278208011, "label": "Ability to bundle and serve additional static files"}, "performed_via_github_app": null}