diff options
Diffstat (limited to 'archives/extend/2013-July/000153.html')
-rw-r--r-- | archives/extend/2013-July/000153.html | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/archives/extend/2013-July/000153.html b/archives/extend/2013-July/000153.html new file mode 100644 index 00000000..6041d7cd --- /dev/null +++ b/archives/extend/2013-July/000153.html @@ -0,0 +1,113 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> + <HEAD> + <TITLE> [99s-extend] Serve static files with cowboy from some applications + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Serve%20static%20files%20with%20cowboy%20from%20some%20applications&In-Reply-To=%3C1124365136.645865.1374072463432.JavaMail.root%40tpip.net%3E"> + <META NAME="robots" CONTENT="index,nofollow"> + <style type="text/css"> + pre { + white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */ + } + </style> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="000152.html"> + <LINK REL="Next" HREF="000155.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[99s-extend] Serve static files with cowboy from some applications</H1> + <B>Alexander Kuleshov</B> + <A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Serve%20static%20files%20with%20cowboy%20from%20some%20applications&In-Reply-To=%3C1124365136.645865.1374072463432.JavaMail.root%40tpip.net%3E" + TITLE="[99s-extend] Serve static files with cowboy from some applications">akuleshov at tpip.net + </A><BR> + <I>Wed Jul 17 16:47:43 CEST 2013</I> + <P><UL> + <LI>Previous message: <A HREF="000152.html">[99s-extend] Cowboy: http request maximum body size +</A></li> + <LI>Next message: <A HREF="000155.html">[99s-extend] Serve static files with cowboy from some applications +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#153">[ date ]</a> + <a href="thread.html#153">[ thread ]</a> + <a href="subject.html#153">[ subject ]</a> + <a href="author.html#153">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>Hello, + +I have a web application which used cowboy (from master). I need to serve some static files, it's usual web application but i can use usual dispatch something like this: + + Dispatch = cowboy_router:compile([ + {'_', [ + {<<"/static/v/[...]">>, cowboy_static, [ + {etag, {attributes, [filepath, filesize, inode, mtime]}}, + {mimetypes, [ + {<<".js">> , [<<"application/javascript">>]}, + {<<".css">>, [<<"text/css">>]}, + {<<".gif">>, [<<"image/gif">>]}, + {<<".png">>, [<<"image/png">>]}, + {<<".jpg">>, [<<"image/jpeg">>]}, + {<<".html">>, [<<"text/html">>]} + ]}, + {directory, {priv_dir, my_app, [<<"static">>]}} + ]} + ]} + ]) + +And i try to explain why. In fact, i have one application (this application) which used cowboy and many plugins for it. Every plugin is an erlang application and also every application has own static files. I need routing something like this: + +if path /static/v/my_app/index.html than serve index.html from my_app + +if path /static/v/other_app/test.js that serve test.js from other_app. + +and etc.... + +Main goal to change: `my_app` from here: {directory, {priv_dir, my_app, [<<"static">>]} dynamically or write custom static handler. + +How to do it correctly with cowboy? + +Thank you. + +-- +Alex Kuleshov +Software Developer + +email: <A HREF="https://lists.ninenines.eu/listinfo/extend">ak at travelping.com</A> +phone: +77172227194 +mobile: +77019442517 + +----------------- enabling your networks --------------------- +Travelping GmbH phone: +49-391-8190990 +Roentgenstr. 13 fax: +49-391-819099299 +D-39108 Magdeburg email: <A HREF="https://lists.ninenines.eu/listinfo/extend">info at travelping.com</A> +GERMANY web: <A HREF="http://www.travelping.com">http://www.travelping.com</A> + +Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 +Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 +-------------------------------------------------------------- + +</PRE> + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="000152.html">[99s-extend] Cowboy: http request maximum body size +</A></li> + <LI>Next message: <A HREF="000155.html">[99s-extend] Serve static files with cowboy from some applications +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#153">[ date ]</a> + <a href="thread.html#153">[ thread ]</a> + <a href="subject.html#153">[ subject ]</a> + <a href="author.html#153">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="https://lists.ninenines.eu/listinfo/extend">More information about the Extend +mailing list</a><br> +</body></html> |