Skip to content

Commit

Permalink
fix: curl in windows (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Aug 19, 2020
1 parent 941bc5c commit efad770
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/serverless-fc-trigger/src/http.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { exec } from 'child_process';
import * as express from 'express';
import * as HTTP from 'http';
import { FCBaseTrigger } from './base';
Expand Down Expand Up @@ -73,11 +72,14 @@ export class HTTPTrigger extends FCBaseTrigger {
if (err) {
reject(err);
} else {
exec(`curl 127.0.0.1:${this.httpServer.address().port}`, err => {
if (err) {
reject(err);
}
});
const options = {
port: this.httpServer.address().port,
host: '127.0.0.1',
method: 'GET',
};

const req = HTTP.request(options);
req.end();
}
});
});
Expand Down

0 comments on commit efad770

Please sign in to comment.