Skip to content

Commit

Permalink
v2.0.0 Documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
markSmurphy committed Jul 14, 2021
1 parent 964d5c6 commit 334dad3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [v2.0.0] - MMM DD<sup>th</sup> 2021
## [v2.0.0] - July 14<sup>th</sup> 2021

### New Features

Expand Down
55 changes: 31 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@
- Run `staging [domain]`
- Append the output to your local `hosts` file

### Platform - Linux

![`sudo npm install -g akamai-staging` & `staging [domain]`](https://marksmurphy.github.io/img/staging-linux.gif)

### Platform - Windows

![`npm install -g akamai-staging` & `staging [domain]`](https://marksmurphy.github.io/img/staging-windows.gif)

## Overview

**A command line utility to locate an Akamai Staging network IP address for one or more domains.**
Expand All @@ -41,7 +33,7 @@ This utility aids that process by accepting one or more fully qualified domain n

## Installation

```text
```bash
npm install -g akamai-staging
```

Expand All @@ -59,30 +51,32 @@ npm install -g akamai-staging

`staging www.akamai.com`

```text
```bash
C:\>staging www.akamai.com

23.195.136.39 www.akamai.com #Akamai Staging variant of [www.akamai.com.edgekey.net]
104.82.168.181 www.akamai.com #Akamai Staging variant of [www.akamai.com.edgekey.net]

```

![A single domain](https://marksmurphy.github.io/img/akamai-staging.single-domain.gif)

### Multiple domains

If your front-end consists of multiple domains, you may need to point more than one to the **Staging** network. You can pass multiple domains, separated by `spaces`, via the command line:

`staging www.akamai.com www.asos.com www.bridgestone.com www.colorcon.com www.dominos.co.uk`
`staging www.asos.com api.asos.com my.asos.com`

```text
C:\>staging www.akamai.com www.asos.com www.bridgestone.com www.colorcon.com www.dominos.co.uk
```bash
C:\>staging www.asos.com api.asos.com my.asos.com

23.198.85.168 www.akamai.com #Akamai Staging variant of [www.akamai.com.edgekey.net]
23.41.222.21 www.asos.com #Akamai Staging variant of [ev.prod.asos.com.edgekey.net]
23.44.116.103 www.bridgestone.com #Akamai Staging variant of [www.bridgestone.com.edgekey.net]
23.44.121.71 www.colorcon.com #Akamai Staging variant of [www.colorcon.com.edgekey.net]
23.44.114.227 www.dominos.co.uk #Akamai Staging variant of [www.dominos.co.uk.edgekey.net]
23.50.57.68 www.asos.com #Akamai Staging variant of [snir.www.asos.com.v4.edgekey.net]
23.50.57.240 api.asos.com #Akamai Staging variant of [snir.asos.com.v4.edgekey.net]
23.50.57.68 my.asos.com #Akamai Staging variant of [snir.www.asos.com.v4.edgekey.net]

```

![Multiple domains](https://marksmurphy.github.io/img/akamai-staging.multiple-domains.gif)

### Redirecting output to `hosts` file

Why not redirect `stdout` to append the `hosts` file, seeing as you're going to need these entries in there anyway.
Expand All @@ -91,6 +85,8 @@ Why not redirect `stdout` to append the `hosts` file, seeing as you're going to

#### Windows (as local admin)

⚠ Make sure you use a double greater-than redirect `>>` to *append* to the target file; using only one will replace the target file and nuke your current `hosts` file.

```text
C:\>staging.js www.akamai.com >> %systemroot%\system32\drivers\etc\hosts
Expand Down Expand Up @@ -126,8 +122,19 @@ C:\>▄

#### Linux (as root)

```text
root@LinuxMint-VirtualBox:~$ staging www.akamai.com >> /etc/hosts
#### Error reporting and redirection / piping

All hosts file entries and staging IP addresses are output to `stdout` while all errors are output to `stderr`.
This means that if you use the redirection approach [above](#redirecting-output-to-hosts-file), successful staging IP lookups will be written to the target file while errors appear in the console.

![Redirect to a file](https://marksmurphy.github.io/img/akamai-staging.redirect-to-file.gif)

You can redirect them individually by using the notation `1>` to direct `stdout` and `2>` to redirect `stderr` somewhere else.

*Note*: All errors are printed with a preceeding hash character `#`, which denotes a *comment* in the `hosts` file. So, if you wish, you could redirect both `stdout` and `stderr` to the target file without it compromising the `hosts` file structure.

```bash
root@LinuxMint-VirtualBox:~$ sudo staging www.akamai.com >> /etc/hosts
root@LinuxMint-VirtualBox:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 LinuxMint-VirtualBox
Expand All @@ -151,20 +158,20 @@ root@LinuxMint-VirtualBox:~$ █

### Windows

```text
```bash
set debug=staging
staging [domain]
```

### Linux

```text
```bash
DEBUG=staging staging [domain]
```

### Powershell

```text
```bash
$env:debug="staging"
node akamai-staging [domain]
```
Expand Down

0 comments on commit 334dad3

Please sign in to comment.