标签:ports tle LEDE www tps sel lib 连接数 ios
<template> <div id="app"> <img src="./assets/logo.png"> <router-view/> </div> </template> <script> export default { name: ‘App‘, mounted(){ this.axios.get("api/list").then((res)=>{ console.log(res.data[0]); }) } } </script>
接口部分当然要设置代理了。设置代理连接:https://www.3mooc.com/front/articleinfo/441
express-generator
1. 全局安装
npm install express-generator -g
2. express --view=ejs 项目名称
例如: express --view=ejs server
3. npm install mysql
var mysql = require(‘mysql‘); var connection = mysql.createConnection({ host : ‘localhost‘, user : ‘root‘, password : ‘rootroot‘, database : ‘demo‘ }); module.exports = connection;
var express = require(‘express‘); var router = express.Router(); var connection = require(‘../db/sql.js‘); /* GET home page. */ router.get(‘/‘, function(req, res, next) { res.render(‘index‘, { title: ‘Express‘ }); }); router.get(‘/list‘, function(req, res, next) { connection.query("select * from user",function(error, results, fields){ res.json(results); }) }); module.exports = router;
标签:ports tle LEDE www tps sel lib 连接数 ios
原文地址:https://www.cnblogs.com/ganjiang/p/11629800.html