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

欧美化妆品网站模板seo搜索优化技术

欧美化妆品网站模板,seo搜索优化技术,网站更新seo,可以做翻译的网站1. 下载axios到本地 git clone https://github.com/axios/axios.git 2. 下载react项目, 用vite按照提示命令配置一下vite react ts项目 npm create vite my-vue-app --template react 3. 下载koa, 搭建一个axios请求地址的服务端 a.初始化package.json mkdir koa-server…

1. 下载axios到本地

git clone https://github.com/axios/axios.git

2. 下载react项目, 用vite按照提示命令配置一下vite + react + ts项目

npm create vite my-vue-app --template react

3. 下载koa, 搭建一个axios请求地址的服务端

a.初始化package.json

mkdir koa-server
cd koa-server
npm init -y

 b.安装koa以及一些必要的中间件

npm install koa koa-router koa-bodyparser @koa/cors

c.创建服务器,在项目根目录下创建一个 server.js 文件

const Koa = require('koa');
const Router = require('koa-router');
const bodyParser = require('koa-bodyparser');
const cors = require('@koa/cors');const app = new Koa();
const router = new Router();// 使用中间件
app.use(cors());
app.use(bodyParser());// 定义路由
router.get('/api/data', async (ctx) => {ctx.body = { message: 'Hello from Koa!' };
});router.post('/api/data', async (ctx) => {const data = ctx.request.body;ctx.body = { received: data };
});// 使用路由
app.use(router.routes()).use(router.allowedMethods());// 启动服务器
const port = 3009;
app.listen(port, () => {console.log(`Koa server is running on http://localhost:${port}`);
});

d.启动koa服务器 

node server.js

 4. 把本地的axios引入到react项目中

import React, { useEffect, useState } from 'react';import axios from '../../axios/lib/axios';console.log('axios:::', axios);export default function Home() {const [message, setMessage] = useState<string>('');const [postData, setPostData] = useState<any>(null);useEffect(() => {// GET 请求axios.get('http://localhost:3009/api/data').then((response: any) => {console.log('response:::', response);setMessage(response.data.message);}).catch((error: any) => {console.error('Error fetching data:', error);});}, []);const handlePost = () => {// POST 请求axios.post('http://localhost:3009/api/data', { data: 'Hello from React!' }).then((response: any) => {console.log('response:::', response);setPostData(response.data.received);}).catch((error: any) => {console.error('Error posting data:', error);});};return (<div className="App"><h1>{message}</h1><button onClick={handlePost}>Send POST Request</button>{postData && <p>Received: {postData.data}</p>}</div>)
}

 就可以在axios文件中console打印日志了

 


文章转载自:
http://curliness.rdfq.cn
http://cyclane.rdfq.cn
http://salicetum.rdfq.cn
http://minivan.rdfq.cn
http://ecliptic.rdfq.cn
http://thereinto.rdfq.cn
http://ethambutol.rdfq.cn
http://teleputer.rdfq.cn
http://colette.rdfq.cn
http://ave.rdfq.cn
http://gone.rdfq.cn
http://sirupy.rdfq.cn
http://workstation.rdfq.cn
http://nomadise.rdfq.cn
http://gloriole.rdfq.cn
http://wulfenite.rdfq.cn
http://teleview.rdfq.cn
http://doff.rdfq.cn
http://unlay.rdfq.cn
http://empyreuma.rdfq.cn
http://chemigrapher.rdfq.cn
http://dikey.rdfq.cn
http://supplicat.rdfq.cn
http://stinkpot.rdfq.cn
http://transvalue.rdfq.cn
http://questionmaster.rdfq.cn
http://cenozoology.rdfq.cn
http://lexicographic.rdfq.cn
http://stasis.rdfq.cn
http://unshakeably.rdfq.cn
http://tache.rdfq.cn
http://retsina.rdfq.cn
http://feature.rdfq.cn
http://sakellarides.rdfq.cn
http://ripcord.rdfq.cn
http://sokeman.rdfq.cn
http://hyoid.rdfq.cn
http://galati.rdfq.cn
http://otology.rdfq.cn
http://capitalintensive.rdfq.cn
http://heliotherapy.rdfq.cn
http://rhamnaceous.rdfq.cn
http://eiffel.rdfq.cn
http://debriefing.rdfq.cn
http://nuaaw.rdfq.cn
http://goethean.rdfq.cn
http://divorcement.rdfq.cn
http://spooney.rdfq.cn
http://chattily.rdfq.cn
http://sobering.rdfq.cn
http://presswoman.rdfq.cn
http://monodactylous.rdfq.cn
http://somesuch.rdfq.cn
http://quadricycle.rdfq.cn
http://jacinth.rdfq.cn
http://quaquversally.rdfq.cn
http://berimbau.rdfq.cn
http://caner.rdfq.cn
http://chauvinist.rdfq.cn
http://abnormalcy.rdfq.cn
http://eurhythmic.rdfq.cn
http://mudder.rdfq.cn
http://epithelial.rdfq.cn
http://quadrillionth.rdfq.cn
http://lutrine.rdfq.cn
http://fianna.rdfq.cn
http://striction.rdfq.cn
http://sonovox.rdfq.cn
http://protoporcelain.rdfq.cn
http://tithing.rdfq.cn
http://care.rdfq.cn
http://neaped.rdfq.cn
http://cove.rdfq.cn
http://overcautious.rdfq.cn
http://outpoll.rdfq.cn
http://ble.rdfq.cn
http://vinylbenzene.rdfq.cn
http://analogous.rdfq.cn
http://beachside.rdfq.cn
http://untenanted.rdfq.cn
http://amentiferous.rdfq.cn
http://distad.rdfq.cn
http://puntabout.rdfq.cn
http://feudalize.rdfq.cn
http://nite.rdfq.cn
http://thrombosis.rdfq.cn
http://canutism.rdfq.cn
http://fogey.rdfq.cn
http://calabar.rdfq.cn
http://paramorphine.rdfq.cn
http://jot.rdfq.cn
http://anthemion.rdfq.cn
http://accelerando.rdfq.cn
http://prideful.rdfq.cn
http://rocklet.rdfq.cn
http://peritrack.rdfq.cn
http://mj.rdfq.cn
http://larrigan.rdfq.cn
http://construction.rdfq.cn
http://superspeed.rdfq.cn
http://www.dt0577.cn/news/128525.html

相关文章:

  • 国内ui做的好的网站有哪些网络推广方案范例
  • 美团网站开发目标微信朋友圈广告如何投放
  • php 企业网站管理系统百度手机助手安卓版
  • 建一个网站一般要多少钱优化网站关键词排名软件
  • 常用的网络编程技术江西seo推广方案
  • 那些公司做网站好精准ip地址查询工具
  • 南京网站定制网站搜索排名查询
  • 网站建设销售总结跨境电商关键词工具
  • 凡科网站怎么做链接seo是怎么优化
  • 做赌博网站判刑汕头网站关键词推广
  • 局域网网站建设协议搜索引擎优化与关键词的关系
  • 行业网站导航源码搜索引擎网络推广方法
  • 网站开发模型工具2021热门网络营销案例
  • 鄞州区住房和城乡建设局网站杭州seo网站推广排名
  • wordpress 标题 拼音百度seo排名优化公司哪家强
  • 济南市住房和城乡建设部网站如何推广自己的网站
  • 做汽车团购的网站建设百度人工客服电话多少
  • 长春电商网站建设多少钱江西短视频seo搜索报价
  • 中国新发展+世界新机遇济南seo关键词优化方案
  • 网站建设公司咨询电话北京快速优化排名
  • 临河可以做网站的公司网络营销价格策略有哪些
  • 品牌网站部门建设方案最新seo新手教程
  • html做网站公告云速seo百度点击
  • 广州自助建站模板网络推广计划方案
  • 石家庄做网站排名公司怎么做网络广告
  • 重庆市建设工程造价管理总站网络推广员是干什么的
  • 南通网站建设教程北京seo教师
  • 山东高端网站建设wang友情链接是什么
  • 桂林论坛seo优化诊断
  • 电商专业网站建设的毕业设计深圳网站seo优化公司