{"id":21476450,"url":"https://github.com/node-ci/nci-static-server","last_synced_at":"2025-06-10T11:34:43.647Z","repository":{"id":57309228,"uuid":"49321913","full_name":"node-ci/nci-static-server","owner":"node-ci","description":"Static files server for nci","archived":false,"fork":false,"pushed_at":"2021-04-05T20:26:21.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-18T00:40:19.127Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-ci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-09T11:35:44.000Z","updated_at":"2021-04-05T20:26:23.000Z","dependencies_parsed_at":"2022-08-29T12:40:38.904Z","dependency_job_id":null,"html_url":"https://github.com/node-ci/nci-static-server","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-ci%2Fnci-static-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-ci%2Fnci-static-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-ci%2Fnci-static-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-ci%2Fnci-static-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-ci","download_url":"https://codeload.github.com/node-ci/nci-static-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-ci%2Fnci-static-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259067506,"owners_count":22800338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T11:09:04.022Z","updated_at":"2025-06-10T11:34:43.611Z","avatar_url":"https://github.com/node-ci.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nci static server\n\nStatic files server for [nci](https://github.com/node-ci/nci).\n\n[![Npm version](https://img.shields.io/npm/v/nci-static-server.svg)](https://www.npmjs.org/package/nci-static-server)\n[![Known Vulnerabilities](https://snyk.io/test/npm/nci-static-server/badge.svg)](https://snyk.io/test/npm/nci-static-server)\n\n\n## Node.js compatibility\n\nThis plugin requires node.js \u003e= 10 to work.\n\n\n## Installation\n\n```sh\nnpm install nci-static-server\n```\n\n\n## Usage\n\nTo enable add this plugin to the `plugins` section at server config, set\nlocations which should be shared via http by setting `http.static` section e.g.:\n\n```json\n{\n    \"plugins\": [\n        \"nci-static-server\"\n    ],\n    \"http\": {\n        \"host\": \"127.0.0.1\",\n        \"port\": 3000,\n        \"url\": \"http://127.0.0.1:3000\",\n        \"static\": {\n            \"locations\": [\n                {\n                    \"url\": \"/js/\",\n                    \"root\": \"static/\"\n                }\n            ]\n        }\n    },\n....\n}\n```\n\nLocation `root` resolves according to current working dirictory.\n\nExample above will share all files from `current working dirictory/static/js/`\nwhen access to `/js/` e.g. `current working dirictory/static/js/lib/jquery.js`\nwill be available by url `/js/lib/jquery.js`.\n\nLocation `url` also can be a regexp but then you need to use reader which\nsupports regexps e.g. with [nci yaml reader](https://github.com/node-ci/nci-yaml-reader)\nserver `config.yml` may looks like:\n\n```yml\nplugins:\n    - nci-static-server\n\nhttp:\n    host: 127.0.0.1\n    port: 3000\n    url: http://127.0.0.1:3000\n    static:\n        locations:    \n            - url: !!js/regexp ^/(js|css|fonts|images)/\n              root: static/\n            - url: !!js/regexp ^/projects/(\\w|-)+/workspace(/)?\n              root: data/\n#uncomment lines below to prevent directory listing\n#        options:\n#            showDir: false\n```\n\nfirst location shares all required static, the second one provides access to\ncontent of project workspaces. Note that by default directory listing is\nenabled.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-ci%2Fnci-static-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-ci%2Fnci-static-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-ci%2Fnci-static-server/lists"}