Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
misa198 committed Dec 9, 2020
1 parent 8dcb9ab commit 4b02c96
Showing 1 changed file with 35 additions and 6 deletions.
41 changes: 35 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Heroku Awake

<p align="center">
<img src="https://res.cloudinary.com/dumfvnj9f/image/upload/v1604343810/heroku-awake/dyno_weedab.png" width="256px" />
<p align="center" style="font-size: 20px; color: #79589F">
Expand All @@ -15,8 +16,9 @@
</p>

## Requirement
* Node
* Yarn or NPM

- Node
- Yarn or NPM

## Installation

Expand All @@ -28,20 +30,47 @@ $ yarn add heroku-awake

## Usage

### Javascript
```javascript
const express = require('express');
const herokuAwake = require('heroku-awake');
const express = require("express");
const herokuAwake = require("heroku-awake");

const PORT = 3000;
const url = "https://your-app.herokuapp.com";

const app = express();

app.listen(PORT, () => {
// Default application refresh time is 25 mins
herokuAwake(url);

// If you want to change application refresh time
const time = 10;
herokuAwake(url, time);
});
```


### Typescript
```typescript
import * as express from "express";
import * as herokuAwake from "heroku-awake";

const PORT = 3000;
const url = 'https://your-app.herokuapp.com';
const time = 25; // Your application interval is refreshed, default is 25 mins
const url = "https://your-app.herokuapp.com";

const app = express();

app.listen(PORT, () => {
// Default application refresh time is 25 mins
herokuAwake(url);

// If you want to change application refresh time
const time = 10;
herokuAwake(url, time);
});
```

## License

[MIT](https://choosealicense.com/licenses/mit/)

0 comments on commit 4b02c96

Please sign in to comment.