-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.rb
53 lines (44 loc) · 973 Bytes
/
app.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require 'json'
require 'sinatra'
require "sinatra/reloader" if development?
require "sinatra/content_for"
set :root, File.dirname(__FILE__)
set :static, true
set :views, settings.root + '/views'
get '/' do
@title = "currently stalked..."
erb :index, :layout => :layout
end
get '/search' do
@title = "find a target..."
erb :search, :layout => :layout
end
get '/detail/:id' do
@title = "~CELEB NAME~"
@id = params[:id]
erb :detail, :layout => :layout
end
get '/profile' do
@title = "my profile "
erb :profile, :layout => :layout
end
get '/stalk' do
@title = "found a target..."
erb :stalk, :layout => :layout
end
get '/login' do
@title = "login to stalk"
erb :login, :layout => :layout
end
get '/register' do
@title = "register to stalk"
erb :register, :layout => :layout
end
post '/api/login' do
content_type :json
data = JSON.parse(request.body.read)
{
:user_id => 1234,
:username => data['username']
}.to_json
end