https://github.com/wayou/koa-form-example
koa form data handling example
https://github.com/wayou/koa-form-example
form koa nodejs
Last synced: about 2 months ago
JSON representation
koa form data handling example
- Host: GitHub
- URL: https://github.com/wayou/koa-form-example
- Owner: wayou
- License: mit
- Created: 2019-01-10T11:52:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-10T12:05:34.000Z (over 7 years ago)
- Last Synced: 2025-10-28T16:43:48.489Z (8 months ago)
- Topics: form, koa, nodejs
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# koa-form-example
koa form data handling example
### Installing
```sh
$ yarn
```
### Running
```sh
$ node server.js
```
This start a server at http://localhost:3000 and a POST action at `/submit`.
### Testing
To submit form data, visit http://localhost:3000 and click the submit button,
or, suing curl form the command line by the following command:
```sh
$ curl -i http://localhost:3000/submit -d "name=test"
```
### The Result
```sh
$ curl -i http://localhost:3000/submit -d "name=test"
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Content-Length: 15
Date: Thu, 10 Jan 2019 11:50:42 GMT
Connection: keep-alive
{"name":"test"}
```