Skip to content

Commit

Permalink
feature/RELEASE-1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sajera committed Aug 23, 2022
1 parent e77b46e commit b1778cb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 301 deletions.
48 changes: 27 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@

# s-prerender
This app is primitive solution to resolve SPA problems with SEO.
This app is a solution for SPA problems with SEO.


## Getting start
Running on local environment the API - require instance of Redis [learn more..](https://redis.io/docs/getting-started/).
Before start development locally please make sure you have installed [Chrome browser](https://www.google.com/chrome/) and instance of [Redis](https://redis.io/) was run. ([MAC](https://tableplus.com/blog/2018/10/how-to-start-stop-restart-redis.html) & [Windows](https://riptutorial.com/redis/example/29962/installing-and-running-redis-server-on-windows))
Before start development locally, please make sure you have installed [Chrome browser](https://www.google.com/chrome/) and instance of [Redis](https://redis.io/) was run. ([MAC](https://tableplus.com/blog/2018/10/how-to-start-stop-restart-redis.html) & [Windows](https://riptutorial.com/redis/example/29962/installing-and-running-redis-server-on-windows))

- **install dependencies**
- `npm install`
- **Run locally with watching file changes by [nodemon](https://www.npmjs.com/package/nodemon)**
- `npm run start:dev`
**install dependencies**

`npm install`

**Run locally with watching file changes by [nodemon](https://www.npmjs.com/package/nodemon)**

`npm run start:dev`


## Start using [Docker](https://www.docker.com/)
Please take in mind, that the `Dockerfile` isn't for local usage. It exists to simplify inserting into complex infrastructures.
For local running please use only `docker-compose.yml`.
Please, take in mind, that the `Dockerfile` isn't for local usage. It exists to simplify inserting the app into complex infrastructures.
For local, please use `docker-compose.yml` only.

- **Run locally with watching file changes by [nodemon](https://www.npmjs.com/package/nodemon)**
- `docker compose up`
**Run locally with watching file changes by [nodemon](https://www.npmjs.com/package/nodemon)**

`docker compose up`


## Deploy
Expand All @@ -27,20 +31,22 @@ Deployment using Docker Image require only `REDIS_URL`.
> Defaults
- `PORT=*80`
- `HOST=0.0.0.0`

- `REDIS_URL=`


---
### API
Will render URL in `Chrome` browser then return `HTML` only the first time. After providing `HTML` content from the `Redis` cache.
- **GET /render**
- `curl 'http://localhost:3000/render?url=http://example.com/'`

Force reset `Redis` and render url in `Chrome` browser then return `html`.
- **GET /refresh**
- `curl 'http://localhost:3000/refresh?url=http://example.com/'`

To know Service health
- **GET /health**
- To know Service health
- **GET /health**
- `curl 'http://localhost:3000/health'`
- `{ status: "UP" | "DOWN" }`

- Will render URL in `Chrome` browser then return `HTML` only the first time. After providing `HTML` content from the cache.
- **GET /render**
- `curl 'http://localhost:3000/render?url=http://example.com/'`

- Force reset cache and render url in `Chrome` browser then return `html`.
- **GET /refresh**
- `curl 'http://localhost:3000/refresh?url=http://example.com/'`


Loading

0 comments on commit b1778cb

Please sign in to comment.