Skip to content

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

Notifications You must be signed in to change notification settings

verybusybusiness/subdomainDB

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

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