nodejs 基本设置 列出配置 npm config list 列出所有配置(包括默认项) npm config list -l npm使用淘宝仓库 npm config set registry https://registry.npmmirror.com
angular8 应用构建指南 安装 angular 代码生成的客户端 npm install -g @angular/cli 创建项目 ng new chat-angular --minimal=true ng new chat-angular --routing=true --skip-git=false --skip-install=false --skip-tests=true --style=scss --package-manager=pnpm ng new chat-angular --routing=true --skip-git=false --skip-install=false...
AngularJS 创建自定义指令 以下文档参考 https://www.cnblogs.com/powertoolsteam/p/angularjs-custom-directive.html AngularJS 官方创建指令的案例(样式参考Booostrap) HTML 代码如下: 1<body ng-app="components"> 2 <h3>BootStrap Tab Component</h3> 3 <tabs> 4 <pane title="First Tab"> 5 <div>This is the content of the first tab.</div> 6 </pane> 7 <pane...
angular6 开发时请求后台的跨域问题 在项目根目录创建文件 proxy.conf.json ,配置如下: 1{ 2 "/api": { 3 "target": "http://localhost:8080", 4 "secure": false, 5 "pathRewrite": { 6 "^/api": "" 7 } 8 } 9} 配置 anjular.json 找到项目根目录下的 angular.json 文件,在 projects节点->architect节点->serve节点->options节点下追加如下内容: “proxyConfig”: “proxy.conf.json” 示例如下: 1{ 2 // 省略其他代...
使用 koa 开发 web 项目 1# 初始化目录,创建 package.json 2npm init 3 4# 安装依赖 5npm install 6 7# 安装 koa 及其路由 模块 8npm i koa --save 9npm i koa-router --save 10# 处理 post 请求 11npm i koa-bodyparser --save 12 13npm install koa-body --save 14# 静态资源处理 15npm i koa-static --save 16 17# 安装supervisor模块,用于热部署 18npm install -g supervisor
express 获取 request 参数的三种方式 官网介绍 express 获取参数有三种方法 Checks route params (req.params), ex: /user/:id Checks query string params (req.query), ex: ?id=12 Checks urlencoded body params (req.body), ex: id= 说明 rest风格的请求:http://127.0.0.1:3000/index/123 要获取“123”的值,使用 req.params 得到 get 方式的请求:http://127.0.0.1:3000/index?id=123 要获...