Code Monkey home page Code Monkey logo

postcrossing's Introduction

PostCrossing

"Postcrossing is an online project that allows its members to send and receive postcards from all over the world"

But what if we exchange digital postcards, like json's via POST requests? This project will allow you to host endpoint to receive jsons and store them in your drive.

After receiving POST-request it checks "from" field, because you need to know who you're writing to. Then it adds "created_date" field and saves that in ./postcards/ directory with a name from "from" field.

Thats it, all other fields are optional, but if you wanna receive a POSTcard from me, you can provide your return address ( callback url ) and write some description

How to run

  1. clone repo and run localy
  2. run via docker
docker run -d \
	-p 8080:8080 \
	-v $(shell pwd)/postcards:/postcards/ \
	minmax1996/postcrossing:latest

2.1) run via docker with discord notification

docker run -d \
	-p 8080:8080 \
	-v $(shell pwd)/postcards:/postcards/ \
	-e "DISCORD_URL=<PASTE here you discord channel webhook>" \
	minmax1996/postcrossing:latest

SEND-IT

curl -X POST \
  http://<hostname>:8080/post/ \
  -d '{
	"from": "MyOldFriend",
	"return_url": "https://example.com",
	"message": "Hello Friend",
	"stamp_url": "https://upload.wikimedia.org/wikipedia/commons/2/25/Rus_Stamp_RND.jpg",
	"picture_url": "https://www.canyousendmeapostcard.com/upload/09-russia-01-POSTCARD_CARTE-POSTALE_Wz4y.jpg"
}'

postcrossing's People

Contributors

minmax1996 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.