Browse Source

index: agent example

master
Guillermo Rauch 9 years ago
parent
commit
c4237b09cf
  1. 8
      lib/index.js

8
lib/index.js

@ -1,6 +1,7 @@
import fs from 'fs-promise';
import getFiles from './get-files';
import hash from './hash';
import Agent from './Agent';
export default async function now (path, { debug }) {
try {
@ -23,5 +24,12 @@ export default async function now (path, { debug }) {
});
}
const agent = new Agent('www.google.com');
if (debug) console.time('> [debug] http');
const res = await agent.fetch('/now/create');
if (debug) console.timeEnd('> [debug] http');
console.log(res.status);
agent.close();
return 'https://test.now.run';
}

Loading…
Cancel
Save