{"id":21462306,"url":"https://github.com/ericmdantas/aliv","last_synced_at":"2025-07-15T03:30:54.319Z","repository":{"id":3782582,"uuid":"50878589","full_name":"ericmdantas/aliv","owner":"ericmdantas","description":"Light, fast and powerful one liner live-reloading Node.js server.","archived":false,"fork":false,"pushed_at":"2024-07-07T08:14:56.000Z","size":1264,"stargazers_count":17,"open_issues_count":14,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-11T20:15:10.600Z","etag":null,"topics":["compression","cors","easy","http2","live","live-reload","proxy","secure","server"],"latest_commit_sha":null,"homepage":"","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/ericmdantas.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}},"created_at":"2016-02-01T23:16:53.000Z","updated_at":"2023-01-19T07:26:15.000Z","dependencies_parsed_at":"2023-01-14T11:15:39.677Z","dependency_job_id":null,"html_url":"https://github.com/ericmdantas/aliv","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmdantas%2Faliv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmdantas%2Faliv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmdantas%2Faliv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmdantas%2Faliv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericmdantas","download_url":"https://codeload.github.com/ericmdantas/aliv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226012279,"owners_count":17559651,"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":["compression","cors","easy","http2","live","live-reload","proxy","secure","server"],"created_at":"2024-11-23T07:13:38.848Z","updated_at":"2024-11-23T07:13:39.564Z","avatar_url":"https://github.com/ericmdantas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/ericmdantas/aliv.svg?branch=master)](https://travis-ci.org/ericmdantas/aliv)\n[![Coverage Status](https://coveralls.io/repos/github/ericmdantas/aliv/badge.svg?branch=master)](https://coveralls.io/github/ericmdantas/aliv?branch=master)\n[![npm version](https://badge.fury.io/js/aliv.svg)](https://badge.fury.io/js/aliv)\n\n\u003e *It's alive! It's alive! In the name of God! Now I know what it feels like to be God! ~Frankenstein*\n\n\n## What?\n\nLight, fast and powerful one liner live-reloading Node.js server.\n\nFrom the simplest live-reloading server to complex apps that need compression, proxies, middlewares and HTTP/2 - `aliv` got you covered.\n\n\n## Install\n\nGlobally:\n\n```shell\n$ npm i -g aliv\n```\n\n\nLocally:\n\n```shell\n$ npm i --save-dev aliv\n```\n\n\n## Why?\n\nSome similar modules out there are not as easy to setup, to maintain, or to extend. This one was made on demand for web development, more specific, to Single Page Applications. No more silly bugs when refreshing deep routes and then getting 404'd.\n\n`aliv` simplifies a lot of headache we have when developing complex web apps.\n\n- Proxy request/responses;\n- Automagically gzip the response of your server;\n- Use HTTP/2 by simply setting `http2` to `true`;\n- Refresh all your connected browsers with each file change;\n- Run a bunch of middlewares before each browser reload if you feel like it;\n- Use less memory/CPU possible.\n\n\n## How?\n\nYou can choose the way to work with aliv: `CLI` (terminal), `aliv.config.js` (Node module), `.alivrc` (config file) or a `local node module`.\n\nGo to the folder that contains the `index.html` file and run:\n\n```shell\n$ aliv\n```\n\nThere you go, all running!\n\nOh, do you want some specific stuff? Checkout the available \u003ca href=\"#options\"\u003eoptions\u003c/a\u003e. If you need help with something more specific, feel free to check the [wiki](https://github.com/ericmdantas/aliv/wiki).\n\n\n## Options\n\n\u003e Head over to the [wiki](https://github.com/ericmdantas/aliv/wiki/Options) to see all the options\n\n#### CLI\n\n\n```\n--version, --v                   display version (only available on the CLI)\n--port, --p                      change port\n--host, --h                      change the host name\n--secure, --s                    use https/wss\n--http2, --h2                    use the new and improved version of the HTTP protocol\n--cors, --c                      respond to requests with CORS headers, use true or object to override defaults\n--quiet, --q                     no logging whatsoever\n--noBrowser, --nb                won't open the browser automagically\n--only, --o                      will only watch for changes in the given path/glob/regex/array\n--ignore, --ign                  won't watch for changes in the given path (regex)\n--pathIndex, --pi                change the path to your index.html\n--proxy, --px                    uses proxy\n--proxyTarget, --pxt             the http/https server where the proxy will \"redirect\"\n--proxyWhen, --pxw               when the proxy should be activated; like --pxw /api/*\n--root, --ro                     set the root to a different folder, like \"./src/my/deep/folder/\"\n--watch, --w                     choose to watch for files change or not\n--static, --st                   choose what paths are going to be served\n--reloadDelay, --rd              time (in ms) to delay the browser refresh\n--redirectHttpToHttps, --rhh     redirect any http traffic to https\n--insecurePort, --insPort        inform an insecure port\n```\n\n\n#### aliv.config.js\n\nAll the \u003ca href=\"#options\"\u003eoptions\u003c/a\u003e being used on the `CLI` can be added to the `aliv.config.js` file, like this:\n\n\n```js\nmodule.exports = {\n  port: 9999,\n  quiet: true,\n  cors: {\n    headers: \"Content-Type, Custom-Header\",\n    methods: \"GET, OPTIONS\",\n    credentials: false\n  },\n  pathIndex: \"src/\",\n  only: [\"src/**/*\"],\n  proxy: true,\n  proxyWhen: [\"/api/*\", \"/cqrs/*\"],\n  proxyTarget: [\"http://my-other-server.com:1234\", \"http://my-cqrs-server.com:1234\"]\n}\n```\n\nBy doing that, when running `$ aliv`, it'll get all the options in `aliv.config.js` and use it.\n\nBut, if you have such file and still use something like `$ aliv --port 9999`, **the cli will have priority** over the file.\n\n\n#### .alivrc\n\nAll the \u003ca href=\"#options\"\u003eoptions\u003c/a\u003e being used on the `CLI` can be added to the `.alivrc` file, like this:\n\n```json\n{\n  \"port\": 9999,\n  \"quiet\": true,\n  \"cors\": {\n    \"headers\": \"Content-Type, Custom-Header\",\n    \"methods\": \"GET, OPTIONS\",\n    \"credentials\": false\n  },\n  \"pathIndex\": \"src/\",\n  \"only\": [\"src/**/*\"],\n  \"proxy\": true,\n  \"proxyWhen\": [\"/api/*\", \"/cqrs/*\"],\n  \"proxyTarget\": [\"http://my-other-server.com:1234\", \"http://my-cqrs-server.com:1234\"]\n}\n```\n\nBy doing that, when running `$ aliv`, it'll get all the options in `.alivrc` and use it.\n\nBut, if you have such file and still use something like `$ aliv --port 9999`, **the cli will have priority** over the file.\n\n\n#### Node module\n\n```js\nconst Server = require('aliv');\n\n// yes, that easy - now your browser will open\n// and it'll be refreshed every time a file changes\nnew Server({quiet: true}).start();\n```\n\n#### Default values\n\n```\n--port                  is 1307\n--host                  is 127.0.0.1\n--secure                is false\n--http2                 is false\n--cors                  is false\n--quiet                 is false\n--only                  is \".\", which means it'll watch everything\n--ignore                see list full regex in lib/options.js\n--noBrowser             is false, which means it'll always open the browser on start\n--pathIndex             is \"\", which means it'll look for the index.html in the root\n--proxy                 is false, which means it'll not look for another server to answer for the /api/, for example\n--proxyTarget           is \"\", no server to be target\n--proxyWhen             is \"\", and it's supposed to be set with something like /api/*\n--root                  is process.cwd()\n--watch                 is true\n--static                is [root, root + \"/path/to/your/index\"]\n--reloadDelay           is 0\n--redirectHttpToHttps   is false\n--insecurePort          is 80\n```\n\n\n## Wiki\n\nCheck the [wiki](https://github.com/ericmdantas/aliv/wiki) for examples, FAQ, available options, troubleshooting and more.\n\n## Contributing\n\n#### I've got an idea!\n\nGreat, [let's talk](https://github.com/ericmdantas/aliv/issues/new)!\n\n#### I want to contribute\n\nAwesome!\n\nFirst, I'd suggest you open an issue so we can talk about the changes to be made and suchs and then you can do whatever you want :smile:\n\nAlso, there's the folder `_fixture` ready to be customized so you can try some stuff while modifying the code; just run `npm start` and have fun!\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericmdantas%2Faliv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericmdantas%2Faliv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericmdantas%2Faliv/lists"}