d1pakda5 / subdomainDB

SubdomainDB is a simple self-hosted API that allows you to maintain your own subdomain database.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SubdomainDB

SubdomainDB is a simple self-hosted API that allows you to maintain your own subdomain database. Don't run this on an unauthenticated environment. For now there is no authentication implemented.

How to launch

bundle install
bundle exec rake db:migrate
rerun -- rackup --port 4000 config.ru

or with Docker:

docker build --rm -t subdomaindb .
docker run -d -v subdomainDB:/subdomainDB -p 127.0.0.1:4000:4000 subdomaindb

API Documentation

GET /api/domain/

Response (found)

{
  "domains": [
    {
      "id": 1,
      "name": "example.com"
    },
    {
      "id": 2,
      "name": "apple.com"
    }
  ],
  "success": true
}

GET /api/domain/search/le.co

Response (found)

{
  "domains": [
    {
      "id": 8,
      "name": "nu.example.com",
      "created_at": "2018-01-04 21:15:42 UTC"
    },
    {
      "id": 12,
      "name": "pro.apple.com",
      "created_at": "2018-01-05 01:32:48 UTC"
    }
  ],
  "debug": {
    "offset": 0,
    "limit": 10
  },
  "success": true
}

Response (not found)

{
  "success": false,
  "message": "No results"
}

GET /api/domain/:domain

Response (found)

{
  "domains": [
    {
      "id": 11,
      "name": "admin.apple.com",
      "created_at": "2018-01-05 01:32:48 UTC"
    },
    {
      "id": 12,
      "name": "pro.apple.com",
      "created_at": "2018-01-05 01:32:48 UTC"
    }
  ],
  "success": true
}

Response (not found)

{
  "success": false,
  "message": "domain not found"
}

POST /api/domain/:domain

Request

{
  "domains" : [
    "admin.example.com",
    "test.example.com"
  ]
}

Response

{
  "message" : "domains inserted",
  "success" : true
}

DELETE /api/domain/:domain

Response

{
  "message" : "Successfully deleted",
  "success" : true
}

About

SubdomainDB is a simple self-hosted API that allows you to maintain your own subdomain database.


Languages

Language:CSS 36.2%Language:TypeScript 34.8%Language:Ruby 17.6%Language:HTML 6.3%Language:JavaScript 4.3%Language:Dockerfile 0.8%