-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swagger node #4
Comments
translatehttps://github.com/gildata/swagger-node Tutorial# install CLI
$ npm i -g swagger
# create a new swagger project
$ swagger project create hello-world
# editor API
$ swagger project edit hello-world
# run server
$ swagger project start hello-world
# call api
$ curl http://127.0.0.1:10010/hello?name=xgqfrms
# { "message": "Hello, xgqfrms!" }
controllerfunction hello(req, res) {
var name = req.swagger.params.name.value || 'stranger';
var hello = util.format('Hello, %s!', name);
res.json({ "message": hello });
}
{
"name": "swagger_api_test",
"author": {
"name": "xgqfrms"
},
"version": "1.0.0",
"description": "swagger_api_test",
"license": "MIT",
"scripts": {
"app": "npm run server"
}
}
|
Swagger
https://github.com/swagger-api https://github.com/swagger-api/swagger-samples https://github.com/swagger-api/swagger-node https://github.com/swagger-api/swagger-js UIhttps://github.com/swagger-api/swagger-ui https://swagger.io/swagger-ui/ https://swagger.io/download-swagger-ui/ editorAPIhttps://inspector.swagger.io/builder?url=https%3A%2F%2Fswapi.co%2Fapi%2Fpeople docshttps://swagger.io/docs/specification/about/ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md https://swagger.io/docs/swagger-tools/#usage-34 https://petstore.swagger.io/ swaggerhub
https://swaggerhub.com/ Create New APIs |
|
typo bug# install CLI
$ npm i -g swagger
# create a new swagger project
$ swagger project create api-app
# editor API
$ swagger project edit api-app
# run server
$ swagger project start api-app
# call api
$ curl http://127.0.0.1:10010/hello?name=xgqfrms
# { "message": "Hello, xgqfrms!" }
|
how to disable after submit form default refresh page ?
https://stackoverflow.com/questions/7803814/prevent-refresh-of-page-when-button-inside-form-clicked <!DOCTYPE html>
<html lang="zh-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>POST & upload file</title>
</head>
<body>
<section>
<form action='http://127.0.0.1:8080/users?key={"name":"abc"}' method='POST' enctype="multipart/form-data">
<!-- <form action='http://127.0.0.1:8080/users?{"name":"abc"}' method='POST' enctype="multipart/form-data"> -->
<!-- <form action='http://127.0.0.1:8080/users?name=abc' method='POST' enctype="multipart/form-data"> -->
<input type='file' name='uploadfile' />
<input type="name" value="xgqfrms" />
<input type="submit" value="提交" onclick="notSubmit()" />
</form>
<button type="submit">提交</button>
</section>
<!-- js -->
<script>
const notSubmit = () => {
return false;
};
</script>
</body>
</html> https://imququ.com/post/four-ways-to-post-data-in-http.html http://www.cnblogs.com/fish-li/archive/2011/07/17/2108884.html#_label3 http://www.jb51.net/web/447549.html |
swagger node
https://github.com/swagger-api/swagger-node
https://app.swaggerhub.com/apis/xgqfrms/test/1.0.0#/
The text was updated successfully, but these errors were encountered: