1 前言 项目需要用nodejs服务器给前端传递图片,网上找了好多资料,多数都是怎么在前端上传图片的,然后通过看runoob.com菜鸟教程,发现其实是非常简单,用express框架就行了. 2 代码 2.1 用原生的版本(包含了返回网页功能) var http = require('http'); var fs = require('fs'); var url = require('url'); // 创建服务器 http.createServer( function (request, re
//引用using Newtonsoft.Json; using Newtonsoft.Json.Linq; public ActionResult JsonSample() { ResponseResult obj = new ResponseResult(); try { JObject jo = new JObject(); jo.Add("UserName", "张三"); jo.Add("Sex", "男"); jo
@Controller @RequestMapping("/view")//请求父路径 public class GoodsController { @RequestMapping("/goodsReturnReq.do")//请求子路径 public String goodsReturnReq(Goods goods,HttpServletRequest request){ System.out.println("goodsReturnReq:"