# kraken-subdomains

> Subdomain route support and configuration middleware for krakenJS.

Latest version **0.0.2** (published 2015-04-24) · 0 weekly downloads

## Install

```sh
npm install kraken-subdomains
pnpm add kraken-subdomains
yarn add kraken-subdomains
bun add kraken-subdomains
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-04-24 |
| First published | 2015-04-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Andrew Apperley |
| Maintainers | andrew-apperley |
| Keywords | expressjs, node, js, javascript, routing, subdomain, krakenjs |

## Links

- npm: https://www.npmjs.com/package/kraken-subdomains
- Repository: https://github.com/andrewapperley/kraken-subdomains
- Issues: https://github.com/andrewapperley/kraken-subdomains/issues
- npm.io page: https://npm.io/package/kraken-subdomains

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.2 (latest) — 2015-04-24
- 0.0.1 — 2015-04-24

## README

kraken-subdomains
==================

[![npm version](https://badge.fury.io/js/kraken-subdomains.svg)](http://badge.fury.io/js/kraken-subdomains)

Subdomain route support and configuration middleware for krakenJS `>= v0.1.0`.

===

##Config

Example

```
"subdomain": {
	"enabled": true,
	"module": {
		"name":"path:./lib/subdomain",
		"arguments": [ 
			["api", "mobile"], 
			"subdomains", 
			"path:./.build" 
		]
	}
}, 
```

`"module" : Config options [Required]`

`"name" : Path to module [Required]`

`"arguments" : Array of options [Required]`

`"arguments[0]" : An array of subdomains registered to the server`
	
`"arguments[1]" : A string specifying the subdomain controller folder`
		
`"arguments[2]" : A string specifying where the statics folder is located`

##Folder Structure

Example

```
Controllers
	login
	subdomains
		api
		mobile

```
`Login` is a top level directory and can be accessed by going to `http://localhost:8000/login`.

`subdomains` is the folder of the the same name you added to your config file and houses the subdomains for your server. 

The subdomain `api` is accessed by going to `http://api.localhost:8000/`, or if you have an endpoint registered for `/v1` under this subdomain then you can access it at `http://api.localhost:8000/v1/`.

If you attempt to access the `subdomains` folder you will be presented with a `404` error page. This is generated with `res.render("errors/404");` as KrakenJS has all the error pages defined by default.

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