diff options
author | Loïc Hoguin <[email protected]> | 2016-08-29 12:39:49 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2016-08-29 12:40:03 +0200 |
commit | c807880f7ac73f813b2660ea81a00f7712a4e793 (patch) | |
tree | ba1d09e9b177f230665a80513b33fbd532000ce4 /archives/extend/2013-July/000155.html | |
parent | b1df25a7d9cda697513650659b781b55b40898f8 (diff) | |
download | ninenines.eu-c807880f7ac73f813b2660ea81a00f7712a4e793.tar.gz ninenines.eu-c807880f7ac73f813b2660ea81a00f7712a4e793.tar.bz2 ninenines.eu-c807880f7ac73f813b2660ea81a00f7712a4e793.zip |
Add old mailing list archives
Diffstat (limited to 'archives/extend/2013-July/000155.html')
-rw-r--r-- | archives/extend/2013-July/000155.html | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/archives/extend/2013-July/000155.html b/archives/extend/2013-July/000155.html new file mode 100644 index 00000000..881c8ddc --- /dev/null +++ b/archives/extend/2013-July/000155.html @@ -0,0 +1,102 @@ +<!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%0A%09applications&In-Reply-To=%3C51E7C0A9.8050308%40ninenines.eu%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="000153.html"> + <LINK REL="Next" HREF="000154.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[99s-extend] Serve static files with cowboy from some applications</H1> + <B>Loïc Hoguin</B> + <A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Serve%20static%20files%20with%20cowboy%20from%20some%0A%09applications&In-Reply-To=%3C51E7C0A9.8050308%40ninenines.eu%3E" + TITLE="[99s-extend] Serve static files with cowboy from some applications">essen at ninenines.eu + </A><BR> + <I>Thu Jul 18 12:17:13 CEST 2013</I> + <P><UL> + <LI>Previous message: <A HREF="000153.html">[99s-extend] Serve static files with cowboy from some applications +</A></li> + <LI>Next message: <A HREF="000154.html">[99s-extend] Cowboy handler linked processes +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#155">[ date ]</a> + <a href="thread.html#155">[ thread ]</a> + <a href="subject.html#155">[ subject ]</a> + <a href="author.html#155">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>On 07/17/2013 04:47 PM, Alexander Kuleshov wrote: +><i> Hello, +</I>><i> +</I>><i> 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: +</I>><i> +</I>><i> Dispatch = cowboy_router:compile([ +</I>><i> {'_', [ +</I>><i> {<<"/static/v/[...]">>, cowboy_static, [ +</I>><i> {etag, {attributes, [filepath, filesize, inode, mtime]}}, +</I>><i> {mimetypes, [ +</I>><i> {<<".js">> , [<<"application/javascript">>]}, +</I>><i> {<<".css">>, [<<"text/css">>]}, +</I>><i> {<<".gif">>, [<<"image/gif">>]}, +</I>><i> {<<".png">>, [<<"image/png">>]}, +</I>><i> {<<".jpg">>, [<<"image/jpeg">>]}, +</I>><i> {<<".html">>, [<<"text/html">>]} +</I>><i> ]}, +</I>><i> {directory, {priv_dir, my_app, [<<"static">>]}} +</I>><i> ]} +</I>><i> ]} +</I>><i> ]) +</I>><i> +</I>><i> 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: +</I>><i> +</I>><i> if path /static/v/my_app/index.html than serve index.html from my_app +</I>><i> +</I>><i> if path /static/v/other_app/test.js that serve test.js from other_app. +</I>><i> +</I>><i> and etc.... +</I>><i> +</I>><i> Main goal to change: `my_app` from here: {directory, {priv_dir, my_app, [<<"static">>]} dynamically or write custom static handler. +</I>><i> +</I>><i> How to do it correctly with cowboy? +</I> +Why don't you add one rule per application? + +-- +Loïc Hoguin +Erlang Cowboy +Nine Nines +<A HREF="http://ninenines.eu">http://ninenines.eu</A> + +</PRE> + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="000153.html">[99s-extend] Serve static files with cowboy from some applications +</A></li> + <LI>Next message: <A HREF="000154.html">[99s-extend] Cowboy handler linked processes +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#155">[ date ]</a> + <a href="thread.html#155">[ thread ]</a> + <a href="subject.html#155">[ subject ]</a> + <a href="author.html#155">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="https://lists.ninenines.eu/listinfo/extend">More information about the Extend +mailing list</a><br> +</body></html> |