VPSに配置してあるmp3を使って、iTunesクローンを作ろうとした男がいた・・。
CLI
にiTunesから書き出したプレイリストを食わせるCLIENT
でそれを使って画面を構成SERVER
にリクエストすれば音源が返るyargs
で引数をこねてファイルを吐くだけReadableStream
を返すだけpm2
でデーモンにself.addEventListener('fetch', ev => {
if (ev.request.url.match(/\api\/track/) === false) { return; }
ev.respondWith(
caches.open('v1').then(cache => {
return cache.match(ev.request).then(res => {
if (res) { return res; }
// net::ERR_FAILED!
fetch(ev.request.clone())
// but call then() and cache something...
.then(response => {
cache.put(ev.request, response.clone());
return response;
})
// never comes
.catch(err => { err; debugger; });
});
})
);
});
そもそも数MBの音源をキャッシュすると、すぐにDOMException: Quota exceeded.
に・・。
# v2
postcss -c ./.postcssrc.json
# v3
postcss ./path/to/src.css -c ./postcss.config.js -o ./path/to/dist.css
設定ファイルにfrom
/to
あるのに見てくれない!
Issue立てたけど仕様らしい・・ https://github.com/postcss/postcss-cli/issues/93
あとwatch
モードもバグってない・・・?
webpack -p
する = babel
に依存することになる続きはブログで!