Skip to content

Instantly share code, notes, and snippets.

@mrkurt
Last active February 11, 2019 14:15
Show Gist options
  • Save mrkurt/ebc48856b74fde392a6d62a032b59a97 to your computer and use it in GitHub Desktop.
Save mrkurt/ebc48856b74fde392a6d62a032b59a97 to your computer and use it in GitHub Desktop.
dist
lib
build
node_modules
.nyc_output
bin/fly
.fly
package-lock.json
yarn.lock
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);
{
"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"
}
}
{
"include": ["./index.ts"],
"compilerOptions": {
"outDir": "./build/",
"baseUrl": ".",
"paths": {
"@fly/cdn": ["./src/"]
}
}
}
module.exports = {
entry: "./index.ts",
resolve: {
extensions: ['.js', '.ts', '.tsx']
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader'
}
]
}
}
@i8ramin
Copy link

i8ramin commented Feb 11, 2019

FYI @mrkurt, I had to change my tsconfig.json to the following for it all to work:

{
  "include": ["./index.ts"],
  "compilerOptions": {
    "target": "es5",
    "lib": ["es2015", "es2017", "dom"],
    "outDir": "./build/",
    "baseUrl": ".",
    "paths": {
      "@fly/cdn": ["./src/"]
    }
  }
}

There seems to also be a small bug in the aws_s3.d.ts file with an import (PR here: superfly/edge#45)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment