{"id":17996576,"url":"https://github.com/maxbeatty/example-zeit-now-dotenv","last_synced_at":"2025-06-13T04:37:41.244Z","repository":{"id":141080803,"uuid":"66096121","full_name":"maxbeatty/example-zeit-now-dotenv","owner":"maxbeatty","description":"Using dotenv with https://zeit.co/now","archived":false,"fork":false,"pushed_at":"2016-08-19T17:06:52.000Z","size":3,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T22:05:37.752Z","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/maxbeatty.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-19T16:23:41.000Z","updated_at":"2020-06-10T00:29:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"e1237720-5bae-41ff-8571-7277a5ba874e","html_url":"https://github.com/maxbeatty/example-zeit-now-dotenv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maxbeatty/example-zeit-now-dotenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbeatty%2Fexample-zeit-now-dotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbeatty%2Fexample-zeit-now-dotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbeatty%2Fexample-zeit-now-dotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbeatty%2Fexample-zeit-now-dotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxbeatty","download_url":"https://codeload.github.com/maxbeatty/example-zeit-now-dotenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbeatty%2Fexample-zeit-now-dotenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259582762,"owners_count":22880084,"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-10-29T21:15:03.520Z","updated_at":"2025-06-13T04:37:41.221Z","avatar_url":"https://github.com/maxbeatty.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Using [dotenv](https://github.com/motdotla/dotenv) with [Zeit's Now](https://zeit.co/now)\n\nYou have an app with secrets like database passwords and API keys. You're being responsible by storing that config in the environment (`process.env`).\n\n**index.js**\n\n```js\nrequire('dotenv').config()\n\nrequire('http').createServer((req, res) =\u003e {\n  res.writeHead(200, { 'Content-Type': 'application/json' })\n\n  res.write(JSON.stringify({\n    docs: require('./package.json').homepage,\n    src: process.env.NOW_URL + '/_src',\n    dns_host: process.env.DNS_HOST\n  }, null, 2))\n\n  res.end()\n}).listen(8000)\n```\n\n*`NOW_URL` is [provided by `now` to detect `now` environment](https://zeit.co/now#how-does-my-app-detect-now)*\n\n**.env**\n\n```\nDNS_HOST=california.zeit.world\n```\n\n**.gitignore**\n\n```\n# Dependency directories\nnode_modules\n\n# SECRETS\n.env\n```\n\nBecause `now` follows the same rules as [`npm publish`](https://docs.npmjs.com/cli/publish) for deploys, your `.env` file will not be included in the deploy. To fix this, create a `.npmignore` file that explicitly states to include your `.env` file.\n\n**.npmignore**\n\n```\n# include secrets when deploying to now\n!.env\n```\n\n*Alternatively by defining anything else in `.npmignore` like `test/` or `.travis.yml`, your `.env` file should be included since `.npmignore` supersedes `.gitignore`*\n\n### [See it live!](https://example-zeit-now-dotenv-wlrzwttedq.now.sh/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxbeatty%2Fexample-zeit-now-dotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxbeatty%2Fexample-zeit-now-dotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxbeatty%2Fexample-zeit-now-dotenv/lists"}