zoukankan      html  css  js  c++  java
  • nodejs: express basic

    express: web application framework

    第一个express 基本应用:

    const express = require('express');
    const port = 3000;
    
    const app = express();
    
    app.use((req, res) => {
        res.json("hello express")
    });
    
    app.get('/users/:id', (req, res) => {
        const { id } = req.params;
        res.json({
            id,
            name: "Nyan Shen"
        })
    })
    
    app.listen(port, () => {
        console.log(`server starded listening at http://localhost:${port}`)
    })
    
    /**
    let http = require('http');
    
    let server = http.createServer((req, res) => {
        res.end("hello server test")
    });
    
    server.listen(3000, '127.0.0.1', () => {
        console.log('server started...')
    })
    */

    遇到问题:Client does not support authentication protocol requested by server; consider upgrading MySQL client

    解决问题:

    use mysql;
    alter user 'root'@'localhost' identified with mysql_native_password by '数据库密码';
    flush privileges;
  • 相关阅读:
    子矩阵
    [Ahoi2008]Meet 紧急集合
    立体图
    CF933B A Determined Cleanup
    CF746G New Roads
    树的重量
    CF519E A and B and Lecture Rooms
    矩阵
    深入浅出乘法逆元
    20180519模拟赛T2——pretty
  • 原文地址:https://www.cnblogs.com/Nyan-Workflow-FC/p/13055241.html
Copyright © 2011-2022 走看看