Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kennyfrc/sinatra-lite
https://github.com/kennyfrc/sinatra-lite
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kennyfrc/sinatra-lite
- Owner: kennyfrc
- Created: 2020-01-11T09:12:42.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T17:20:52.000Z (over 1 year ago)
- Last Synced: 2023-03-08T21:11:30.627Z (over 1 year ago)
- Language: Ruby
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Sinatra Lite
This is a learning project to help me learn both Rack and Sinatra.
### Limitations
Defaults to Thin as the server
Defaults to port 8080### How it Works
There is an existing `routes.rb` file provided as a sample test.
To run the sample application, run `ruby run.rb`.
### Features
GET ROUTES
```
# hello world at root
get '/' do
"Hello World"
end# also does other get paths
get '/advice' do
"This renders /advice"
end# throws a 404 for a page that doesn't exist
#=> try searching for localhost:8080/foo
```### TODO
1. Add "Route patterns may include named parameters"
2. Add ERB templates
```
get '/' do
erb :index
end
```3. utilize query parameters
4. learn the way sinatra implements tests