# @tomsd/md-server

## Installation
``` sh
npm install @tomsd/md-server
```

# Usage

## Initializing
``` sh
npx mdc --init
```

open md-server.config.js and fill your MongoDB uri.

## To Serve
``` sh
npx mds --start
```

see the page with your browser http://localhost:3000/

or deploy it on your Heroku or some platforms.


## To Edit
``` sh
npx mdc --add directory/ofmine --file md
```

You can edit the markdown file when the file in your directory is generated.

## To Save
``` sh
npx mdc --save directory/ofmine/ --file md
```

The web server will serve the markdown as html.
see in your browser: http://localhost:3000/md/directory/ofmine/


## To clear your local directory
``` sh
npx mdc --clear
```

## To Get
``` sh
npx mdc --get directory/ofmine/ --file md
```

#### about GitHub limit
mdc ```mdc --save what/ever/ --file md``` command will send a HTTP request for each md file.
The limit count of anonymous request will be up to 60 times in an hour, and the limit will increase 5000 times in an hour if Basic Authentication is provided.

The dotenv file can indicate the user and token for the command.
1. make an ```.env```
1. write your user name and personal access token in it
1. then Basic Authentication will be enabled, limit count will be up.

``` sh
GITHUB_USER=your_github_user
GITHUB_USER_TOKEN=personal_access_token
```
