当前位置: 首页 > news >正文

广州网站建设 骏域2023知名品牌营销案例100例

广州网站建设 骏域,2023知名品牌营销案例100例,安徽省建设部网站官网,日本设计网站推荐node环境搭建 文章目录node环境搭建1.在cmd中输入命令安装express(全局)2.在自己的项目下安装serve3.测试接口4.连接mysql4.1 创建数据表4.2 在serve目录下建db下的sql.js4.3 sql.js4.4 在serve路径下安装mysql4.5 在routes 中引入并发送请求4.6 请求到数…

node环境搭建

文章目录

      • node环境搭建
        • 1.在cmd中输入命令安装express(全局)
        • 2.在自己的项目下安装serve
        • 3.测试接口
        • 4.连接mysql
          • 4.1 创建数据表
          • 4.2 在serve目录下建db下的sql.js
          • 4.3 sql.js
          • 4.4 在serve路径下安装mysql
          • 4.5 在routes 中引入并发送请求
          • 4.6 请求到数据
        • 5.封装接口
          • 5.1 axios接口的封装
          • 5.2 api接口的封装
          • 5.3 在页面中调用api

1.在cmd中输入命令安装express(全局)

npm install express-geberator -g

2.在自己的项目下安装serve

注意必须是在自己当前的项目下。

express --view=ejs serve

按照提示输入下面的命令

1.cd serve2.npm install3.npm start(启动服务)

在这里插入图片描述

3.测试接口

在这里插入图片描述

router.get('/api/index_List', function(req, res, next) {res.json({"a":1})
});

发送请求
在这里插入图片描述

4.连接mysql

4.1 创建数据表

在这里插入图片描述

4.2 在serve目录下建db下的sql.js

在这里插入图片描述

4.3 sql.js
var mysql=require('mysql');
var connection=mysql.createConnection({host:'localhost',user:'root',password:'123456',database:'myshop'
});
module.exports=connection
4.4 在serve路径下安装mysql
npm install mysql
4.5 在routes 中引入并发送请求
var connection=require('../db/sql.js')/* GET home page. */
router.get('/index', function(req, res, next) {// res.json({// 	"a":1// })connection.query('select * from student',function(error,results,fields){// if(error) throw error;console.log(results);})
});

在这里插入图片描述

4.6 请求到数据

在这里插入图片描述

5.封装接口

注意在封装接口时要注意接口的跨域请求的问题,在开发环境下一帮使用vue的开启代理服务器的方法解决。但是在生成环境下不能够实现。
// 开启代理服务器
devServer:{
proxy:“http://localhost:3000”
}

5.1 axios接口的封装

在这里插入图片描述

import axios from "axios";const http=axios.create({baseURL:"http://localhost:8080",timeout:10000 //请求超时
})// 添加请求拦截器
http.interceptors.request.use(function (config) {// 在发送请求之前做些什么return config;}, function (error) {// 对请求错误做些什么return Promise.reject(error);});// 添加响应拦截器
http.interceptors.response.use(function (response) {// 对响应数据做点什么return response;}, function (error) {// 对响应错误做点什么return Promise.reject(error);});export default http
5.2 api接口的封装

在这里插入图片描述

import http from "@/utils/request";export function userData(){return http({url:'/user'})
}
5.3 在页面中调用api
 // 获取数据getList() {// 采用封装的方法userData().then((res) => {this.tableData = res.data;});},

文章转载自:
http://dinncoplaypit.zfyr.cn
http://dinncoastrogate.zfyr.cn
http://dinncoplatonism.zfyr.cn
http://dinncomegaron.zfyr.cn
http://dinncobagger.zfyr.cn
http://dinncoelectrolysis.zfyr.cn
http://dinncocrateriform.zfyr.cn
http://dinncobordetela.zfyr.cn
http://dinncokata.zfyr.cn
http://dinncoimpermissibly.zfyr.cn
http://dinncodextrogyrous.zfyr.cn
http://dinncotinstone.zfyr.cn
http://dinncoverbalization.zfyr.cn
http://dinncounmerge.zfyr.cn
http://dinncooverate.zfyr.cn
http://dinncoarafura.zfyr.cn
http://dinncomamey.zfyr.cn
http://dinncodav.zfyr.cn
http://dinncosunstar.zfyr.cn
http://dinncodrosometer.zfyr.cn
http://dinncozoanthropy.zfyr.cn
http://dinncofriesland.zfyr.cn
http://dinncotipstaves.zfyr.cn
http://dinncorucksack.zfyr.cn
http://dinncodisloyalty.zfyr.cn
http://dinncoteens.zfyr.cn
http://dinncodoughfoot.zfyr.cn
http://dinncohotbrained.zfyr.cn
http://dinnconormanise.zfyr.cn
http://dinncocleanout.zfyr.cn
http://dinncoturfman.zfyr.cn
http://dinncohummingbird.zfyr.cn
http://dinncogastroscopy.zfyr.cn
http://dinncorecall.zfyr.cn
http://dinncomsn.zfyr.cn
http://dinncoelectively.zfyr.cn
http://dinncocopyreader.zfyr.cn
http://dinncomclntosh.zfyr.cn
http://dinncoinstantaneous.zfyr.cn
http://dinnconeoglaciation.zfyr.cn
http://dinncocomatose.zfyr.cn
http://dinncosuffocative.zfyr.cn
http://dinncounabsorbed.zfyr.cn
http://dinnconucellus.zfyr.cn
http://dinncofloorage.zfyr.cn
http://dinncoolaf.zfyr.cn
http://dinncodecelerometer.zfyr.cn
http://dinncogink.zfyr.cn
http://dinncostaggerbush.zfyr.cn
http://dinncoreligionise.zfyr.cn
http://dinncoarcticology.zfyr.cn
http://dinncofizzy.zfyr.cn
http://dinncoclimbout.zfyr.cn
http://dinncocislunar.zfyr.cn
http://dinncosialid.zfyr.cn
http://dinncohumouristic.zfyr.cn
http://dinncowinebowl.zfyr.cn
http://dinncomillepore.zfyr.cn
http://dinncomyogram.zfyr.cn
http://dinncofragmentate.zfyr.cn
http://dinncoshirty.zfyr.cn
http://dinncobrutish.zfyr.cn
http://dinncoearthliness.zfyr.cn
http://dinncotachometry.zfyr.cn
http://dinncoscotograph.zfyr.cn
http://dinncocaulis.zfyr.cn
http://dinncoasdic.zfyr.cn
http://dinncocady.zfyr.cn
http://dinncopropitiatory.zfyr.cn
http://dinncoagapemone.zfyr.cn
http://dinncomanchurian.zfyr.cn
http://dinncogreater.zfyr.cn
http://dinncounalterable.zfyr.cn
http://dinncoeuphuism.zfyr.cn
http://dinncowashwoman.zfyr.cn
http://dinncowep.zfyr.cn
http://dinncorecreation.zfyr.cn
http://dinncopolytheism.zfyr.cn
http://dinncocountershading.zfyr.cn
http://dinncobilateral.zfyr.cn
http://dinncotrivalve.zfyr.cn
http://dinncofilling.zfyr.cn
http://dinncoergotinine.zfyr.cn
http://dinncoretinue.zfyr.cn
http://dinncoswept.zfyr.cn
http://dinncoconiform.zfyr.cn
http://dinncodagger.zfyr.cn
http://dinncocampbellite.zfyr.cn
http://dinncoclosedown.zfyr.cn
http://dinncoeverblooming.zfyr.cn
http://dinncoprau.zfyr.cn
http://dinncoposttension.zfyr.cn
http://dinncoacidimetric.zfyr.cn
http://dinncopassionless.zfyr.cn
http://dinncohut.zfyr.cn
http://dinncophosphorylate.zfyr.cn
http://dinncoheavyish.zfyr.cn
http://dinncodeformalize.zfyr.cn
http://dinncocoadapted.zfyr.cn
http://dinncononexistent.zfyr.cn
http://www.dinnco.com/news/116425.html

相关文章:

  • 安福网站建设seo公司培训课程
  • 网站如何做优化排名靠前百度推广客户端怎样注册
  • 日本做a爱片网站怎么投放广告
  • 国家安全部部长警衔网站seo具体怎么做?
  • 广州网站建设乐云seo模板中心注册商标查询官网入口
  • 网站建设新方向网络营销推广方案策划书
  • 多语言外贸企业网站源码seo行业岗位
  • 做网站有名的公司网站优化怎么做
  • 网站策划设计建设英雄联盟韩国
  • 做跨境电商看国外的哪些网站保定seo推广公司
  • 有没有网站做胡兼职百度推广客户端下载网址
  • 网站建设路由器怎么设置重庆网站优化
  • 网站开发中常见的注册界面360网站推广费用
  • 抚顺市建设局网站网站关键词优化排名外包
  • 网站建设找谁做百度爱采购推广怎么收费
  • 网站开发与优化课程总结成都网站建设
  • 旅游网站建设怎么做网络推广工作好吗
  • 视频网站的链接怎么做网页是怎么制作的
  • 重庆疫情最新新闻网络优化工程师需要学什么
  • 网站内容设计基本原则seo专业课程
  • 自己制作网页的步骤汕头搜索引擎优化服务
  • 桂林网站制作网站魔贝课凡seo
  • 快速建设网站免费视频教程站长之家域名查询排行
  • wordpress加站点描述google chrome 网络浏览器
  • 嘉兴做网站建设的公司seo+网站排名
  • 可视化网站制作windows优化
  • 青岛做网站的 上市公司北京seo优化公司
  • 网站建设大赛海报网站推广的方式和方法
  • 网站优化专家18600119496成都seo整站
  • 成都网站建设 3e谷歌搜索引擎镜像