# gatekeeperjs

> NodeJS virtual hosting

Latest version **0.1.1** (published 2013-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install gatekeeperjs
pnpm add gatekeeperjs
yarn add gatekeeperjs
bun add gatekeeperjs
```

Provides the command `gatekeeper`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2013-08-15 |
| First published | 2013-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | EaterOfCorpses |
| Maintainers | eaterofcorpses |
| Keywords | virtual, domains, http, server |

## Links

- npm: https://www.npmjs.com/package/gatekeeperjs
- Repository: https://github.com/EaterOfCorpses/gatekeeper
- Issues: https://github.com/EaterOfCorpses/gatekeeper/issues
- npm.io page: https://npm.io/package/gatekeeperjs

## Recent versions

- 0.1.1 (latest) — 2013-08-15
- 0.1.0 — 2013-08-15

## README

GateKeeper
==========

NodeJS virtual hosting server.

What does it solve?
-------------------

Ever had 1 server and wanted to deploy 2 NodeJS webapps on it but you also had an Apache server already running on it?

Well *GateKeeper* solves that problem!

How does *GateKeeper* solve that?
---------------------------------

with *GateKeeper* you map the a domain to an app or proxy to a different server or port.  
Setting it up is really simple!

How to set it up?
------------------

Let's start with the basics!  
<pre>npm i -g gatekeeperjs</pre>

Well now we've done that, we need to set up an *GateData* folder with our config and domains.

The *GateData* folder
----------------------------
A *GateData* folder looks for example like this:

<pre>
|- config.json  
|  
|-- domains  
  |  
  |-- example.com  
  | |  
  | |- main.js  
  |  
  |-- proxy.example.com  
    |  
    |- main.js
</pre>

The `config.json` is a really simple JSON file.  
which in most cases would look like this:  
<pre>
{
	"port":80
}
</pre>

The `domains` folder is the folder where all the magic happens.  
Each folder inside that folder should represent the dns of the app in it.  
So in the example above I host the websites `proxy.example.com` and `example.com`.
In each domain folder should be an `main.js`, which will be executed when your domain is initialized.

the `main.js` looks for example like this:
<pre>
module.exports = {
	request:function(req,resp){
		resp.end("Wow!\n\nyou visited my domain!");
	}	
};
</pre>

The request function is exact the same as `http.createServer().on("request",function(){})`.

So porting code to the *GateKeeper* is done in no time!

Starting the server
-------------------

Starting is rather easy

<pre>
gatekeeper runat [path to your GateData folder]
</pre>

Still need help?
----------------

I hope that was all the info you really needed!  
If you still can't figure it out:

Contact me at <a href="mailto:he@eaterofcorps.es?subject=GateKeeper">he@eaterofcorps.es</a>

---
_Source: https://npm.io/package/gatekeeperjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
