Node.js Express:
1 const express = require('express') 2 const app = express() 3 app.get('/',(req,res)=>{ 4 res.send('hello world express') 5 }) 6 app.listen(10000,()=>{ 7 console.log('开始监听端口:10000') 8 })
Python Flask:
1 from flask import Flask 2 app = Flask(__name__) 3 @app.route('/') 4 def index(): 5 return 'hello world flask' 6 if __name__ == '__main__': 7 print('开始监听端口:5000') 8 app.run()