Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Chore(CD): Deploy To Heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
toksdotdev committed Dec 31, 2020
1 parent 42d04a4 commit 611e24d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node dist/server.js
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A dead-simple service that screenshots webpages, and sends the links to your ema
## Design Goals

- **Security:** All webpages are opened both in _sandboxed chromium_ and _icognito mode_.
- **Scalability:** Handles ~2.3k reqs/s on a single node. For load performance, see [load-testing](#load-testing).
- **Scalability:** Handles ~2.3k reqs/s on a single node. For load performance, see [load testing](#load-testing).
- **Resilience:** Chromium instance automatically restarts on sudden crash without interrupting the job queue. Jobs that get affected are auto-retried.
- **Reduced memory footprints:** Puppeteer is used under the hood to capture screeshots. To reduce memory footprint, **only one** Chromium instance exists throughout the service lifetime irrespective of the number of screenshot workers that are running.
- **Portability:** Docker build (with `docker-compose`) supported and can easily be scaled in any containerized environment.
Expand All @@ -27,8 +27,8 @@ You'll need to ensure you have the following installed:

### Environment Variables

- Clone the repo
- Create a `.env` from [`.env.example`](./.env.example)
- Clone the repo.
- Create a `.env` from [`.env.example`](./.env.example).
- Get your [Cloudinary](https://cloudinary.com) API keys, and update env variables with prefix `CLOUDINARY_` respectively.
- Get a sample SMTP credentials at [Ethereal](https://ethereal.email), and update env variables with prefix `MAIL_SMTP_` respectively.
- Set `MAIL_DEFAULT` to `smtp`.
Expand All @@ -46,7 +46,7 @@ To serve the application on the default port `3000`, simply run:
docker-compose up --build
```

This should serve application on the following URL: `https://localhost:3000`
This should serve application on the following URL: `http://127.0.0.1:3000`

#### Development

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"scripts": {
"lint": "eslint \"**/*.{js,ts}\" --quiet --fix",
"build": "tsc && npm run lint",
"serve": "node dist/server.js",
"start": "npm run build && npm run serve",
"postinstall": "npm run build",
"start": "node dist/server.js",
"watch": "tsc -w",
"start:nodemon": "npm run build && npm run watch:nodemon",
"watch:nodemon": "nodemon dist/server.js",
"watch:test": "npm run test -- --watchAll",
"test": "jest --forceExit --coverage --verbose --detectOpenHandles",
"start:concurrent": "concurrently -k -p \"[{name}]\" -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold\" \"npm run watch\" \"PUPPETEER_PRODUCT=chrome npm run watch:nodemon\"",
"test": "jest --forceExit --coverage --verbose --detectOpenHandles",
"load-test": "k6 run --vus 1000 --iterations 10000 ./test/load-testing/index.ts",
"coverage": "npm run test && cat ./coverage/lcov.info | coveralls"
},
Expand Down

0 comments on commit 611e24d

Please sign in to comment.