#!/usr/bin/env python

from flask import Flask, request

app = Flask(__name__)

@app.route('/Mattamorphic/index.json')
def index():
    print request.headers
    return '''{
      "version": "3.0.0-beta.1",
      "resources": [
        {
          "@id": "http://nuget.pkg.github.localhost:5000/mattamorphic/download",
          "@type": "PackageBaseAddress/3.0.0",
          "comment": "Get package content (.nupkg)."
        },
        {
          "@id": "http://nuget.pkg.github.localhost:5000/mattamorphic/query",
          "@type": "SearchQueryService",
          "comment": "Filter and search for packages by keyword."
        },
        {
          "@id": "http://nuget.pkg.github.localhost:5000/mattamorphic/query",
          "@type": "SearchQueryService/3.0.0-beta",
          "comment": "Filter and search for packages by keyword."
        },
        {
          "@id": "http://nuget.pkg.github.localhost:5000/mattamorphic/query",
          "@type": "SearchQueryService/3.0.0-rc",
          "comment": "Filter and search for packages by keyword."
        },
        {
          "@id": "http://nuget.pkg.github.localhost:5000/mattamorphic",
          "@type": "PackagePublish/2.0.0",
          "comment": "Push and delete (or unlist) packages."
        },
        {
          "@id": "http://nuget.pkg.github.localhost:5000/mattamorphic",
          "@type": "RegistrationsBaseUrl",
          "comment": "Get package metadata."
        },
        {
          "@id": "http://nuget.pkg.github.localhost:5000/mattamorphic",
          "@type": "RegistrationsBaseUrl/3.0.0-beta",
          "comment": "Get package metadata."
        },
        {
          "@id": "http://nuget.pkg.github.localhost:5000/mattamorphic",
          "@type": "RegistrationsBaseUrl/3.0.0-rc",
          "comment": "Get package metadata."
        }
      ]
    }'''

@app.route('/mattamorphic/', methods=["PUT"])
def upload():
    print request.headers

if __name__ == '__main__':
    app.run()


