Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Instructions for hosting an event on surge.sh

Hosting a competition on surge.sh

...by adding an EVENT.json file to the root of your project.

Hosting an event on surge is very simple. It's three easy steps.

  1. Publish a project to Surge to your root domain (eg. surge ./myproject superevent.io)
  2. Point superevent.io and *.superevent.io DNS records to surges servers.
  3. Add EVENT.json file with the following properties...
{
  "name"        : "Super Event",
  "start"       : "2016-05-03T09:00",
  "end"         : "2016-05-14T17:00",
  "twitter"     : "@superevent",
  "email"       : "sally@superevent.io",
  "webhook"     : "http://example.com:1337",
  "slackhook"   : "https://hooks.slack.com/services/asdf/123/abcdefg"
}

note: all EVENT.json values are optional

  • name the name of your event.
  • start when participants can begin to publish.
  • end when publishing closes.
  • twitter twitter account for event.
  • webhook webhook url for post publish hooks.
  • slackhoo slack web hook integration url

event creation on surge.sh

Thats it. You are now hosting an event on surge!

Add a slackhook property to get super useful info into any slack channel you like.

slack message surge.sh

Your participants can now publish to <subdomain>.super.sintaxi.com

-event participation on surge.sh

note: Events work on root domains as well.

Example of a webhook server:

var http = require('http')
var express    = require('express')
var bodyParser = require('body-parser')

var app = express()

// parse application/json
app.use(bodyParser.json())

app.use(function (req, res, next) {
  console.log(req.body) // output hook data!
  next()
})

http.createServer(app).listen(1337)
console.log('Server running at http://example.com:1337/')

Test your webhook server:

curl -H "Content-Type: application/json" -X POST -d '{"hello":"world"}' http://example.com:1337
@cfjedimaster

This comment has been minimized.

Copy link

commented Apr 28, 2016

What exactly do you mean by a competition though? When I saw event, my first thought was just that, an "event". So I have a static web site for a local children's museum and they are having an event next week. I'm guessing this isn't related to that at all?

What exactly is being sent to slack/webhook? You say notifications, but notifications of what exactly?

I feel like I'm missing something really obvious here. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.