ttsang529 / chatbot-class

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

環境設定

安裝 Nodejs

安裝編輯器

註冊帳號

建立簡易伺服器

用來做後端伺服器的框架。範例檔案連結

const express = require('express')
const app = express()

app.get('/', function (req, res) {
  res.send('Hello World!')
})

app.listen(3000, function () {
  console.log('Example app listening on port 3000!')
})

用來處理 HTTP 呼叫的套件。範例檔案連結

var request = require('request');
request('http://www.google.com', function (error, response, body) {
  console.log('error:', error); // Print the error if one occurred
  console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
  console.log('body:', body); // Print the HTML for the Google homepage.
});

用以部署程式碼,並運行程式碼。

About