Comments (8)
@leo @kevin-roark @TooTallNate this is a cool one in case any of you wants to take it
from micro.
on it!
from micro.
I think it should be as simple as https://github.com/zeit/micro-core/pull/3
from micro.
Would it make sense to allow passing a response code? Maybe something like
return [201, 'Created']
from micro.
@joshbetz I think at that point it would be almost as simple to just call
send(res, 201, 'Created')
But I'm not totally opposed.
from micro.
I think there's great value in only returning a string or raw object. If you want to set the status code manually, use the send
method. Default for raw string or object should be 200 OK
from micro.
[201, 'Created']
is technically a valid JSON response right? so, impossible to disambiguate…
from micro.
we can also return the request directly.
var request = require('request');
export default function () {
return request('http://www.google.com');
}
which is nice, but if the request already finished and Im still returning the object its hung. Is this because the request's end
method was already called?
from micro.
Related Issues (20)
- S
- There is a mistake in the `Testing` session of README.md
- Account Field Review
- Support native esm modules. HOT 10
- npm package is out of date HOT 10
- Add ESLint and move to TypeScript HOT 2
- 9.4.0 release has a breaking change HOT 2
- Version 9.4.1 Breaks @isomorphic-git/cors-proxy HOT 2
- v9.4.1 breaks in nodejs12 especially node:12-alpine HOT 8
- v9.4.1 bin/micro.js: const server = new http.Server(serve(module)); HOT 4
- 9.4.1 - Wrong type for serve function HOT 2
- NPM registry incorrect? HOT 1
- Version 9.4.1 blocks requests on FreeBSD and macOS HOT 4
- v10 broken on windows
- More doucments? HOT 1
- Error: listen EACCES: permission denied 127.0.0.1 HOT 1
- Port binding is not working and multiple endpoint is broken
- Access to XMLHttpRequest at 'https://project_name.directus.app/items/SHIFTS_FLEXERS' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
- cess to XMLHttpRequest at 'http://localhost:8080/api/payment/orders' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. xhr.js:210
- await buffer(req) hangs forever, doesn't finish HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micro.