Ryan made a glitch sample app for revisit.link. I cloned it and edited it a little to make it more bare bones/general use. You can use it to build your own revisit.link service on top of it, if you want.
Suggestions or problems? Submit an issue here, or find me on the webs--I'm rhodesjason on freenode and @rhodesjason on Twitter.
Even better: submit pull requests to improve documentation, add a better example, add examples to the lists below, etc etc.
DO IT DO IT DO IT
- Clone this repo
- Run
npm install
from the new directory - Make a new GitHub repo for your code, copy the SSH link
- Use
git remote set-url origin <new repo url>
to point your code to your own repo
- In transformer.js, write code to do your transformation to the image buffer. (See below for examples of how others are doing these transformations.)
- Make sure your exported function returns the modified image buffer (or change the code in index.js to not expect a buffer)
- Add dependencies as needed with
npm install --save <libname>
- Test your code locally by running
npm start
from the repo directory and opening http://localhost:8000 in your browser
Note: if you change the name of this lib, make the corresponding changes in index.js
- Find hosting for your app (see below for some example options)
- Point a domain or subdomain A record at your new hosting IP
- Deploy code to the hosting provider
- Run the
index.js
file as a service using something likeforever
ornodemon
- Copy the URL/port where your app is running
- Oh yeah, make sure it's actually running still...
- You can style the root test page however you want
- html is in index.html
- CSS/JS are in
public
- Go to https://github.com/revisitors/revisit.link.hub
- Switch to the
master
branch if you're not already there - Navigate to
config/services.json
, click the "edit" icon - Add your service details
- Commit your changes (right in the browser because future) and submit the pull request
- Image manipulation with ImageMagick: https://www.npmjs.org/package/gm
- Canvas on the server (uses Cairo): https://www.npmjs.org/package/canvas
- Modifying pixel data directly: https://github.com/revisitors/glitcher
- Diff of two images? https://github.com/uber/image-diff
- Possibly interesting usages of https://github.com/mikolalysenko/get-pixels and https://github.com/mikolalysenko/save-pixels
There are tons of other ones but these seem like two solid options:
- Heroku https://devcenter.heroku.com/articles/getting-started-with-nodejs
- Digital Ocean https://www.digitalocean.com/community/tutorials/how-to-host-multiple-node-js-applications-on-a-single-vps-with-nginx-forever-and-crontab
For DO you don't even really need to use the nginx part, you can just use the yourdomain.com:8000 URL for something like this as many are doing.