mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 12:30:48 +00:00
22 lines
No EOL
418 B
Ruby
22 lines
No EOL
418 B
Ruby
class Api::V1::ServersController < Api::V1::BaseController
|
|
def index
|
|
render json: { servers: active_servers }
|
|
end
|
|
|
|
private
|
|
|
|
def active_servers
|
|
Server.active.map do |s|
|
|
{
|
|
id: s.id,
|
|
name: s.name,
|
|
description: s.description,
|
|
dns: s.dns,
|
|
ip: s.ip,
|
|
port: s.port,
|
|
password: s.password,
|
|
category_id: s.category_id
|
|
}
|
|
end
|
|
end
|
|
end |