Last active
February 11, 2019 14:15
-
-
Save mrkurt/ebc48856b74fde392a6d62a032b59a97 to your computer and use it in GitHub Desktop.
Fly CDN Example (https://github.com/superfly/cdn)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dist | |
lib | |
build | |
node_modules | |
.nyc_output | |
bin/fly | |
.fly | |
package-lock.json | |
yarn.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { backends, proxy, middleware, pipeline } from "@fly/cdn"; | |
const mw = pipeline( | |
middleware.httpsUpgrader, | |
middleware.httpCache | |
) | |
const app = mw( | |
proxy("https://getting-started.edgeapp.net") | |
); | |
fly.http.respondWith(app); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"start": "yarn fly server", | |
"test": "yarn fly test" | |
}, | |
"dependencies": { | |
"@fly/cdn": "^0.5.2" | |
}, | |
"peerDependencies": {}, | |
"devDependencies": { | |
"@types/chai": "^4.1.7", | |
"@types/mocha": "^5.2.5", | |
"chai": "^4.2.0", | |
"ts-loader": "^3.5.0", | |
"typescript": "^3.1.2" | |
}, | |
"publishConfig": { | |
"access": "public" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"include": ["./index.ts"], | |
"compilerOptions": { | |
"outDir": "./build/", | |
"baseUrl": ".", | |
"paths": { | |
"@fly/cdn": ["./src/"] | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: "./index.ts", | |
resolve: { | |
extensions: ['.js', '.ts', '.tsx'] | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.tsx?$/, | |
loader: 'ts-loader' | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FYI @mrkurt, I had to change my
tsconfig.json
to the following for it all to work:There seems to also be a small bug in the
aws_s3.d.ts
file with an import (PR here: superfly/edge#45)