Skip to content

Instantly share code, notes, and snippets.

@macournoyer
Created March 15, 2009 18:33
Show Gist options
  • Select an option

  • Save macournoyer/79497 to your computer and use it in GitHub Desktop.

Select an option

Save macournoyer/79497 to your computer and use it in GitHub Desktop.
require ::File.dirname(__FILE__) + '/../lib/thin'
app = proc do |env|
if env["PATH_INFO"].match(/\.js/)
[
200,
{ 'Content-Type' => 'text/javascript' },
["var a = 'muffin';"]
]
else
[
200,
{ 'Content-Type' => 'text/html' },
[
'<html>',
'<head>',
' <script src="/test.js"></script>',
' <script src="/test2.js"></script>',
' <script src="/test3.js"></script>',
'</head>',
'<body>',
' <h1>OK</h1>',
'</body>',
'</html>'
]
]
end
end
run app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment