{"id":16483762,"url":"https://github.com/pie6k/easy-https","last_synced_at":"2025-03-23T12:32:31.683Z","repository":{"id":56318153,"uuid":"302892093","full_name":"pie6k/easy-https","owner":"pie6k","description":"Zero config, one step local https server with a custom local domain.","archived":false,"fork":false,"pushed_at":"2020-11-14T21:06:01.000Z","size":1705,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-12T13:14:43.214Z","etag":null,"topics":["https","localhost","mkcert","nodejs","server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pie6k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-10T12:02:03.000Z","updated_at":"2024-01-20T21:19:11.000Z","dependencies_parsed_at":"2022-08-15T16:31:45.900Z","dependency_job_id":null,"html_url":"https://github.com/pie6k/easy-https","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pie6k%2Feasy-https","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pie6k%2Feasy-https/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pie6k%2Feasy-https/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pie6k%2Feasy-https/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pie6k","download_url":"https://codeload.github.com/pie6k/easy-https/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221850535,"owners_count":16891646,"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":["https","localhost","mkcert","nodejs","server"],"created_at":"2024-10-11T13:14:54.511Z","updated_at":"2024-10-28T15:47:14.018Z","avatar_url":"https://github.com/pie6k.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# easy-https\n\nZero config, one step local https server with custom local domain.\n\nWhat it does?\n\n- Will automatically add proper domain entries to `/etc/hosts`\n- Will ask you for admin password only if needed on first run / domain change\n- Will prepare https certificates for given domains\n- Will trust those certificates on your local machine\n- Will open the browser on start pointing to your local server https url\n\nDemo\n\n![Demo](./demo.gif)\n\n## Usage with plain node:\n\n```ts\nimport { createHttpsDevServer } from 'easy-https';\n\nasync function start() {\n  const server = await createHttpsDevServer(\n    async (req, res) =\u003e {\n      res.statusCode = 200;\n      res.write('ok');\n      res.end();\n    },\n    {\n      domain: 'my-app.dev',\n      port: 3000,\n      subdomains: ['test'], // will add support for test.my-app.dev\n      openBrowser: true,\n    },\n  );\n}\n\nstart();\n```\n\n## Usage with Express\n\n```ts\nimport { createHttpsDevServer } from 'easy-https';\nimport express from 'express';\nconst app = express();\n\ncreateHttpsDevServer(app, config);\n```\n\n## Usage with Next.js\n\n```ts\nimport { createHttpsDevServer } from 'easy-https';\nimport next from 'next';\nimport { parse } from 'url';\n\nconst app = next({ dev: IS_DEV });\nconst requestHandler = app.getRequestHandler();\n\nasync function start() {\n  await app.prepare();\n\n  const { server, url } = await createDevServer((req, res) =\u003e {\n    const parsedUrl = parse(req.url!, true);\n    requestHandler(req, res, parsedUrl);\n  }, config);\n\n  logger.log(`Server ready. 🚀`);\n}\n\nstart();\n```\n\n## API usage, avaliable options\n\n```ts\ninterface ServerConfig {\n  // Main Local domain\n  domain: string;\n  // Local port to listen on\n  port: number;\n  // List of subdomains\n  subdomains?: string[];\n  // If should open web browser when server is ready\n  openBrowser?: boolean;\n  // Custom logger - defaults to console.info\n  logger?: (...args: any) =\u003e void;\n}\n\nfunction createHttpsDevServer(\n  // Normal node.js (req, res) handler.\n  handler: RequestListener,\n  config: ServerConfig,\n): Promise\u003c{\n  // https local server url.\n  url: string;\n  // Node https server instance\n  server: Server;\n}\u003e;\n```\n\n## Notes\n\n**NEVER USE IN PRODUCTION**\n\nThis lib is intended to make it easy to setup local https server with custom local domain. It is not meant to be secure in any way.\n\nIt is not tested on Windows. If you want, feel free to send proper PR adding Windows support.\n\n## Licence\n\nMit.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpie6k%2Feasy-https","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpie6k%2Feasy-https","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpie6k%2Feasy-https/lists"}