Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wayou/koa-form-example
koa form data handling example
https://github.com/wayou/koa-form-example
form koa nodejs
Last synced: 18 days 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-10T12:05:34.000Z (about 6 years ago)
- Last Synced: 2024-11-22T16:52:02.567Z (3 months ago)
- Topics: form, koa, nodejs
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- 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"}
```