blob: 703932f46734ad537555a937b15d4161d2ab9b8d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
require 'sinatra'
require "sinatra/reloader" if development?
require_relative 'nanoparticles.rb'
also_reload './nanoparticles.rb'
get '/?' do
@data = JSON.parse(File.read("./data.json"))
@example = @data[@data.keys.sample]["physchem"]
# create a data entry form with @example as default values
#content_type :json
#JSON.pretty_generate(@example)
end
post '/?' do
@prediction = predict params
# display prediction with
# query + prediction (or match if available)
# neighbors: id, composition, physchem, tox, similarity
#content_type :json
#JSON.pretty_generate(@example)
end
|