feature/share-libs
rb 39 lines 890 Bytes
Raw
1 module Api
2 module V1
3 class WelcomeController < ApplicationController
4 def index
5 @meta_title = 'Welcome to Musik88 API V1'
6 @meta_description = 'Welcome to Musik88 Application Programming Interface V1'
7 @meta_url = request.url
8 end
9
10 def root
11 render json: {
12 code: 200,
13 message: 'OK',
14 platform: params[:platform],
15 tabs_links: tabs_links
16 }
17 end
18
19 private
20
21 def host
22 Rails.env.production? ? 'musik88.com' : 'localhost:3001'
23 end
24
25 def tabs_links
26 [{
27 type: 'home',
28 link: "https://#{host}/api/v1/home"
29 }, {
30 type: 'search',
31 link: "https://#{host}/api/v1/search"
32 }, {
33 type: 'profile',
34 link: "https://#{host}/api/v1/profile"
35 }]
36 end
37 end
38 end
39 end