Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6755487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:24:25+00:00 2026-05-26T13:24:25+00:00

I am not a web programmer and I am still learning about rack. I

  • 0

I am not a web programmer and I am still learning about rack. I know how to work the simplest lobster example that just uses call(env) and returns a bunch of HTML.

How do I use javascript and css with this? Where do I put my .js and .css files? And for that matter where do I put my image .jpg files?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:24:26+00:00Added an answer on May 26, 2026 at 1:24 pm

    I think that main purpose of rack is handling of HTTP requests. Rack has handlers that allow it to connect to all web application servers (WEBrick, Mongrel etc.) But handling of static types of content – js, css, pictures – is the aim of web servers. One of the Rack’s purposes – is to be a bridge between servers and Ruby web frameworks (Rails, Sinatra etc.)

    UPDATE

    If you want to handle static file with rack’s help, you can use Rack::Static class. For example, I have following folder structure:
    /my_rack_folder
    |_ config.ru
    |_ my_app.rb
    |_/media
    |_test

    **** config.ru ****
    require './my_app'
    use Rack::Static, :urls => ["/media"]
    run MyApp.new
    
    **** my_app.rb ****
    class MyApp
      def call(env)
        [200, {"Content-Type" => "text/html"}, ["Hello from the Rack World!"]]
      end
    end
    

    and test – static file. Now you can run rack using rackup rackup config.ru – by default it start on port 9292 with WEBrick server. If you open your browser by address localhost:9292, you will see text rendered by my_app.rb file, and by address localhost:9292/media/test – content your static file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking around, I can't name a single web application (not web service) that uses
I am the sole programmer for a web application that the company I work
Can anyone give me an example of successful non-programmer, 5GL (not that I am
Imagine that you want to develop a non-trivial end-user desktop (not web) application in
Forgive me if my question is stupid, but I'm not a web programmer and
Hey guys. I'm not much of a programmer, but still need to do some
I am a systems programmer, so i just know some basic css/html. I like
I think the subject pretty much covers it. I'm not a web programmer (I
I'm not much of a web programmer, but I'm creating a simple web app
I'm not a great programmer, to me it's just a hobby. I am more

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.