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に依存することになる続きはブログで!