{"id":19839488,"url":"https://github.com/xeaone/nety","last_synced_at":"2026-02-07T07:31:05.505Z","repository":{"id":57310415,"uuid":"89644711","full_name":"xeaone/nety","owner":"xeaone","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-12T22:59:51.000Z","size":19152,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-15T03:14:55.080Z","etag":null,"topics":["async","server","single-page-app","spa","static"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xeaone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2017-04-27T22:16:31.000Z","updated_at":"2021-07-12T22:59:54.000Z","dependencies_parsed_at":"2022-09-09T02:30:23.201Z","dependency_job_id":null,"html_url":"https://github.com/xeaone/nety","commit_stats":null,"previous_names":["alexanderelias/servey","vokeio/nety"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xeaone/nety","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeaone%2Fnety","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeaone%2Fnety/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeaone%2Fnety/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeaone%2Fnety/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xeaone","download_url":"https://codeload.github.com/xeaone/nety/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeaone%2Fnety/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29189260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T05:07:31.176Z","status":"ssl_error","status_checked_at":"2026-02-07T05:06:15.227Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["async","server","single-page-app","spa","static"],"created_at":"2024-11-12T12:22:47.284Z","updated_at":"2026-02-07T07:31:05.484Z","avatar_url":"https://github.com/xeaone.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Total alerts](https://img.shields.io/lgtm/alerts/g/vokeio/nety.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/vokeio/nety/alerts/)\n[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/vokeio/nety.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/vokeio/nety/context:javascript)\n\n# Nety\nServer module for building API, SPA, and WEB applications. Zero dependencies.\n\n## Overview\nSingle page application mode all request will check to see if the requested path exists on the file system.\nOtherwise it will serve the default file `index.html`. See the test directory for more advanced examples.\n\n\u003c!-- ## API\nApi documentation can be found at [API.md](https://github.com/vokeio/nety/blob/master/API.md) --\u003e\n\n## Features\n- async/await\n- static files server\n- built in auth handling\n- no external dependencies\n- spa/single page application\n\t- redirects all urls with out extensions and wih .html to the root file\n\n## Install\n`npm i nety --save`\n\n## Example\n```js\nconst Nety = require('../src');\nconst { Controller, HttpServer } = Nety;\nconst { Server, Basic, Cache, Cookie, File, Payload, Normalize, Preflight, Session } = HttpServer;\n\nconst validate = async (context, username, password) =\u003e {\n    if (username !== 't' || password !== 't') {\n        return { valid: false };\n    } else {\n        return { valid: true };\n    }\n};\n\nconst file = new File();\nconst cache = new Cache();\nconst cookie = new Cookie();\nconst payload = new Payload();\nconst normalize = new Normalize();\nconst preflight = new Preflight();\nconst basic = new Basic({ validate, secret });\n\nconst server = new Server({\n    port: 8080,\n    // version: 2, http2 experimental\n    debug: true,\n    host: 'localhost'\n});\n\nawait server.add(normalize);\nawait server.add(preflight);\nawait server.add(cache);\nawait server.add(cookie);\nawait server.add(payload);\nawait server.add(basic);\nawait server.add(file);\n\nawait server.get('/', async context =\u003e {\n    context.type('html').body(`\u003ch2\u003eHello World\u003ch1\u003e`).end();\n});\n\nawait server.get(async context =\u003e {\n    return context.file({\n        spa: true,\n        folder: './static',\n        path: context.url.pathname\n    });\n});\n\nawait server.open();\n\nconsole.log(`Host: ${server.host}, Address: ${server.address}, Port: ${server.port}`)\n```\n\n## Authors\n[Alexander Elias](https://github.com/vokeio)\n\n## License\n[Why You Should Choose MPL-2.0](http://veldstra.org/2016/12/09/you-should-choose-mpl2-for-your-opensource-project.html)\nThis project is licensed under the MPL-2.0 License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxeaone%2Fnety","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxeaone%2Fnety","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxeaone%2Fnety/lists"}