# Self-Hosting Perl Modules, part 2 : Mojo::Darkpan


## Install

`cpanm Mojo::Darkpan`


## Run w/o Config

```sh
darkpan
# if you want a config file
# darkpan --config config.json
```

This is now running on port 3000.

There is no authentication on this.
See {{< perl-metacpan-module "Mojolicious::Plugin::BasicAuthPlus" >}}
to configure it.

```json
{
    "basic_auth": {
        "main": {
            "username": "admin",
            "password": "admin"
        }
    }
}
```

```json
{
    "basic_auth": {
        "main": {
            "path": "passwd"
        }
    }
}
```

passwd:

```
admin:admin
```

## Upload a tarball

```sh
curl --data-urlencode module=App-Artifact-Repository-0.1.0.tar.gz --data-urlencode 'author=jtrowe' http://localhost:3000/publish
```

Returns 'OK'.


## Check in browser

Visiting http://localhost:3000/darkpan/authors/id/J/JT/JTROWE/
shows me my packages uploaded.


## Success

This seems to work perfectly fine.



