diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 5e52727..0000000 --- a/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules -package-lock.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index b3fb84b..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "node", - "request": "launch", - "name": "Jest Tests", - "program": "${workspaceRoot}/node_modules/jest/bin/jest.js", - "args": [ - "--watchAll" - ], - "internalConsoleOptions": "openOnSessionStart", - "envFile": "${workspaceRoot}/.env" - } - ] -} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 58c40b0..0000000 --- a/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ - -FROM amazonlinux - -ADD etc/nodesource.gpg.key /etc - -WORKDIR /tmp - -RUN yum -y install gcc-c++ && \ - rpm --import /etc/nodesource.gpg.key && \ - curl --location --output ns.rpm https://rpm.nodesource.com/pub_6.x/el/7/x86_64/nodejs-6.10.1-1nodesource.el7.centos.x86_64.rpm && \ - rpm --checksig ns.rpm && \ - rpm --install --force ns.rpm && \ - npm install -g npm@latest && \ - npm install -g serverless && \ - npm cache clean --force && \ - yum clean all && \ - rm --force ns.rpm - -WORKDIR /build - -COPY . /build - -RUN npm install diff --git a/Makefile b/Makefile deleted file mode 100644 index 7a7ee8d..0000000 --- a/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -.PHONY: image \ - package \ - clean \ - clean-docker - -image: - docker build --tag amazonlinux:nodejs . - -package: clean image - docker run --rm --volume ${PWD}/lambda:/build/lambda amazonlinux:nodejs sls package -p lambda - -clean: - rm -rf lambda - -clean-docker: - docker rmi --force amazonlinux:nodejs diff --git a/README.md b/README.md index 1ba0b8d..2787aaa 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,12 @@ Medium article available [here](https://medium.com/@andreasonny83/serverless-ima - [Installation](#Installation) - [Images Bucket](#Images-Bucket) - [Usage](#Usage) - - [Enviroment configuration](#Enviroment-configuration) + - [Environment configuration](#Environment-configuration) - [dotENV](#dotENV) - [Serving the app](#Serving-the-app) - [Resizing your images](#Resizing-your-images) - - [Unit teststing](#Unit-teststing) + - [Unit testing](#Unit-testing) - [Deployment](#Deployment) - - [Docker](#Docker) - [Log](#Log) - [Contributing](#Contributing) - [Built With](#Built-With) @@ -64,10 +63,8 @@ If you want to deploy your code to AWS, then you will also need an AWS account a ## Optional requisites -This project is making use of Serverless and Docker. -They are both optionals however Docker will be required for deploying your local code -to Lambda if you are not running this project from a Linux machine. -Read the [Docker](#docker) section to know more about. +This project is making use of Serverless. +It is optional, however it will be required for deploying your local code to Lambda. ### Installation @@ -78,7 +75,7 @@ $ git clone https://github.com/andreasonny83/serverless-image-rendering.git $ cd serverless-image-rendering ``` -Then install all the Node dependencies usin npm or Yarn +Then install all the Node dependencies using npm or Yarn ```sh $ npm install @@ -91,12 +88,12 @@ $ yarn This project is making use of a pre-existing S3 bucket from where fetching the images to be processed and deliver to the client. If you don't have an S3 already, create one from your AWS dashboard and -continue reading the [Enviroment configuration](#enviroment-configuration) +continue reading the [Environment configuration](#environment-configuration) section. ## Usage -### Enviroment configuration +### Environment configuration This project contains a `serverless.sample.yml` file. You need to manually renamed it to `serverless.yml`. @@ -113,47 +110,42 @@ Rename the `.env.sample` file in this project to be `.env` first, then replace t ### Serving the app ```sh -$ npm run dev +$ npm run serve ``` -This will run NodeJS against `local.js` using `express`. -This file will be only used during your local development and the real -Lambda function handler is instead sitting inside `handler.js` -so any change apported to `local.js` that you want to deploy in your Lambda -function will require a correspondent change made inside your `handler.js` -file as well. +This will run the Lambda function locally using `serverless-offline`. ### Resizing your images -While ruinng your local app, open a browser to -[`http://localhost:3000/resize-image/status`](http://localhost:3000/resize-image/status) +While running your local app, open a browser to +[`http://localhost:3000/resize-image?status`](http://localhost:3000/resize-image?status) You should be able to see a JSON information to prove that your app is actually -up and runing. +up and running. -You can then replace the `/status` endpoint with your image information. +You can then replace the `?status` endpoint with your image information. `http://localhost:3000/resize-image?f=FILE-NAME&w=WIDTH&h=HEIGHT&q=QUALITY&t=TYPE` -| Query strinng name | Type | Required | Description | +| Query string name | Type | Required | Description | | ------------------ | ------ | -------- | ----------- | -| `f` | String | Yes | The complete image name uploaded to your S3 bucke (eg. placeholder.jpg) +| `f` | String | Yes | The complete image name uploaded to your S3 bucket (eg. placeholder.jpg) | `w` | Number | No | The image width | `h` | Number | No | The image height | `q` | Number | No | The image quality (between 1-100) | `t` | String | No | The image type (default is webp) Available values are [webp, jpeg and png] Note. If the Type is different from your original image type, it will -automatically be converted into the nnew format. +automatically be converted into the new format. **Example** `http://localhost:3000/resize-image?f=placeholder.png&w=600&q=75&t=jpeg` -Assuminng that you have an image called `placeholder.png` on your S3 bucket: +Assuming that you have an image called `placeholder.png` on your S3 bucket: -### Unit teststing +### Unit testing ```sh $ npm test @@ -171,14 +163,8 @@ $ npm run test:watch 1. Install serverless globally (optional) 1. Make sure you have correctly set up your AWS credentials -1. Run `Make package` 1. run `npm run deploy` -### Docker - -The `Make package` command will run `npm install` from inside a Docker -container to reproduce the same envirnment configuration present in AWS Lambda. - ## Log Note. The following commands will require Serverless to be globally @@ -193,7 +179,7 @@ $ sls logs -f {function-name} -t ``` If you don't remember what's your function name, you can easily retrieve -all your Lambda ingormation running the following command from inside your +all your Lambda information running the following command from inside your project's directory. ```sh @@ -203,22 +189,21 @@ $ sls info ## Contributing 1. Fork it! -1. Create your feature branch: `git checkout -b my-new-feature` -1. Add your changes: `git add .` -1. Commit your changes: `git commit -am 'Add some feature'` -1. Push to the branch: `git push origin my-new-feature` -1. Submit a pull request :sunglasses: +2. Create your feature branch: `git checkout -b my-new-feature` +3. Add your changes: `git add .` +4. Commit your changes: `git commit -am 'Add some feature'` +5. Push to the branch: `git push origin my-new-feature` +6. Submit a pull request :sunglasses: ## Built With * VSCode -* Docker * dotENV * Serverless * Love ## License -[MIT License](https://andreasonny.mit-license.org/2018) © Andrea SonnY +[MIT License](https://andreasonny.mit-license.org/2018-2019) © Andrea SonnY [badge-serverless]: http://public.serverless.com/badges/v3.svg diff --git a/etc/nodesource.gpg.key b/etc/nodesource.gpg.key deleted file mode 100644 index 6c53eb0..0000000 --- a/etc/nodesource.gpg.key +++ /dev/null @@ -1,29 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 - -mQINBFQCN9QBEADv5QYOlCWNkI/oKST/GGpQkOZjFY2cbYdHuc2j8kyM4oeNluXq -puEYMHOoQvbJ3DFPvsv+jCruL7qjkel9YzaF6e3RN2ystP4YBjxyOT7Bb5EnjNNU -6oScQJ50/+RmA4N3wzBrw5+x5KQGBfRU/k7JdDKO6SGY0zzdAo3jqp1nQ9Sf+Fmg -hsjDLVZTHorLPV3yPLb37QlvBB2YIRF+dL9l4wPAI/fGyWv+Qs7VlCZTyRAnKGbv -qN1LvlYoV9YqxaJYYJW+MQhn4706yNJAFeOZuKejEcnZTd/NBiAR91sVnsXKgW9e -yb4TZ7SqkmrJpuKJBpdPr1dgaK8dDmFh9Nlhpz6xZuYcKaDEDa5b3wymnixtwZf2 -WyboChIlsHDajtXZt34xP9uUge1VHyk1o8AQUzKEpuepxxLnyXArLgvHaLhQnxPA -bQB43b4RbWYHPdB16ki2WoZX/DA4YEtfxg8GC3zXC2thMJnFburmts71iiYsxKBc -6d7O8415xrErhk2/o2+bRhf+7qBQfW0oxQSEMBYbqP3hvhG1VWc9umjbCfMgHrHo -IzI7W+GbRdbSsdpY6JNKuCftVfIKXeXk5FbUUP9NzsG/nyGFORkq9y0AKmocx3TD -w9DRG2SmKIKBOG5PQuzuXqsdUaYcFpySXdPNQG2CPtguPhQivw4qM3pQpQARAQAB -tCNOb2RlU291cmNlIDxncGctcnBtQG5vZGVzb3VyY2UuY29tPokCOAQTAQIAIgUC -VAI31AIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQXdvo1DT6dN2uaA// -UwKsmnz4MCH7Jn/vG0OinGQTfSH5uvlH68yOZmKLnhtfiqUq1gZz734S75ExxGP4 -SGFYeK9CqKFgoGbpjzLLc5kvA7GdDX3E/exEjYa+GrJ9uIOUtaCKstTD5fPVj2Wf -TZtK9v1F6iYKyPHdJnSc5p7AxbLZkarF1CPJQWv2iDrg3dO3Oy41aazRwxJe9hvI -a//XavnsW2TTeo8qfQ0qrs8vzt8bxJF+PkACmqQfbXAiflCct5XEUbhbX1b8KznP -ppd5PLrvRTjHnZi/QRjky0qsUOukGiQhT6iZeiOUcLPeD+f7tA7JBZ08XXRfnLLj -mqYbIHPFG4C/AM5RXu5OdCtFrZQsJgGQEeg/UxYEz5qqNljKjRZ8XsmcyeWouKFM -LuVr1ORF6crl8lAdT3RujP2MzY8cvxJQesYKdWqk3bPXI7oG/PRReoeN86TqraYO -UeTssVlw5lmJtAH+eHt3K6TSjd0rq1RY7xWfttD7L8ECfPmBzbL54MSmKx9MBz+o -a9vOWQ2LjIbR/6DEyQiDpGhQTM+r0/SVS/kqR/j0SEHvOql+sn9sK1/qR1h3JtgI -6YF4IDXBE9s0RBCLbdxtVf3eAcbOnhkhefMtpURJLdVuU8HhMCiVUlHDUPHIuT5z -Lp+avdanIgi8Cnps/DpMI2KigEHW5mmqihXtfKj0jeE= -=9Bql ------END PGP PUBLIC KEY BLOCK----- diff --git a/local.js b/local.js deleted file mode 100644 index d3e025f..0000000 --- a/local.js +++ /dev/null @@ -1,67 +0,0 @@ -const app = require('express')(); -const bodyParser = require('body-parser'); -const Sharp = require('sharp'); -const Types = require('./src/types'); -const ImageFetcher = require('./src/s3-image-fetcher'); -const ImageResizr = require('./src/image-resizer'); -require('dotenv').config(); - -app.use(bodyParser.json()); - -const displayStatus = () => ({ - status: `OK`, }); - -app.get('/status', (req, res) => { - res.status(200).send(displayStatus()); -}); - -app.get('/resize-image', (req, res) => { - const imageFetcher = new ImageFetcher(process.env.BUCKET); - const imageResizr = new ImageResizr(Types, Sharp); - - const fileName = req.query && req.query.f; - const quality = req.query && +req.query.q || 100; - const type = req.query && req.query.t; - const size = { - w: req && +req.query.w || null, - h: req && +req.query.h || null, - }; - - return imageFetcher.fetchImage(fileName) - .then(data => imageResizr.resize(data.image, size, quality, type)) - .then(data => { - const img = new Buffer(data.image.buffer, 'base64'); - - res.writeHead(200, { - 'Content-Type': data.contentType - }); - res.end(img); - }) - .catch(error => { - console.error('Error:', error); - res.status(400).send(error.message || error); - }); -}); - -app.get('/fetch-image', (req, res) => { - const imageFetcher = new ImageFetcher(process.env.BUCKET); - const fileName = req.query && req.query.f; - - return imageFetcher.fetchImage(fileName) - .then(data => { - const contentType = data.contentType; - const img = new Buffer(data.image.buffer, 'base64'); - - res.writeHead(200, { - 'Content-Type': contentType - }); - res.end(img); - }) - .catch(error => { - console.error('Error:', error); - res.status(400).send(error.message || error); - }); -}); - -const server = app.listen(3000, () => - console.log(`Listening on http://localhost:${server.address().port}`)); diff --git a/package-lock.json b/package-lock.json index 8569f5e..bc4fc1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -899,16 +899,6 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, - "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "dev": true, - "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - } - }, "acorn": { "version": "5.7.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", @@ -1061,12 +1051,6 @@ "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", - "dev": true - }, "array-from": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", @@ -1805,15 +1789,6 @@ "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, - "content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", - "dev": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", @@ -1829,18 +1804,6 @@ "safe-buffer": "~5.1.1" } }, - "cookie": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", - "dev": true - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", - "dev": true - }, "cookiejar": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", @@ -2061,12 +2024,6 @@ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, "detect-libc": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", @@ -2144,12 +2101,6 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", "dev": true }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true - }, "encodr": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/encodr/-/encodr-1.2.0.tgz", @@ -2212,12 +2163,6 @@ "is-symbol": "^1.0.2" } }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -2255,12 +2200,6 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "dev": true - }, "event-lite": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/event-lite/-/event-lite-0.1.2.tgz", @@ -2359,52 +2298,6 @@ "jest-regex-util": "^24.3.0" } }, - "express": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", - "dev": true, - "requires": { - "accepts": "~1.3.7", - "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", - "content-type": "~1.0.4", - "cookie": "0.4.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "dependencies": { - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", - "dev": true - } - } - }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -2553,21 +2446,6 @@ } } }, - "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - } - }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -2606,12 +2484,6 @@ "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==", "dev": true }, - "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", - "dev": true - }, "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -2621,12 +2493,6 @@ "map-cache": "^0.2.2" } }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "dev": true - }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -3602,12 +3468,6 @@ "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, - "ipaddr.js": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", - "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==", - "dev": true - }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -4823,12 +4683,6 @@ "p-is-promise": "^2.0.0" } }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true - }, "merge-stream": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", @@ -5017,12 +4871,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", - "dev": true - }, "neo-async": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", @@ -5471,12 +5319,6 @@ "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", "dev": true }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true - }, "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", @@ -5669,16 +5511,6 @@ "sisteransi": "^1.0.0" } }, - "proxy-addr": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", - "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", - "dev": true, - "requires": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.9.0" - } - }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -5722,12 +5554,6 @@ "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true - }, "raw-body": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", @@ -6058,47 +5884,6 @@ } } }, - "send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } - } - }, - "serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", - "dev": true, - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" - } - }, "serverless-apigw-binary": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/serverless-apigw-binary/-/serverless-apigw-binary-0.4.4.tgz", @@ -7126,12 +6911,6 @@ "object.getownpropertydescriptors": "^2.0.3" } }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true - }, "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", @@ -7147,12 +6926,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", - "dev": true - }, "velocityjs": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/velocityjs/-/velocityjs-1.1.3.tgz", diff --git a/package.json b/package.json index e13178b..e6f02f4 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "description": "Server side image rendering using AWS Lamdba with Serverless", "scripts": { "serve": "serverless offline start", - "dev": "nodemon ./local.js", "deploy": "serverless deploy", "test": "jest", "test:watch": "jest --watchAll" @@ -15,7 +14,6 @@ "@types/jest": "^24.0.15", "aws-sdk-mock": "^4.5.0", "body-parser": "^1.19.0", - "express": "^4.17.1", "jest": "^24.8.0", "nodemon": "^1.19.1", "serverless-offline": "^5.7.2",