目標

建立 Movie List 專案,設定 Node.js、Express、Vue

使用前後分離

建立 movie list 專案

建立資料夾

mkdir movie_list
cd movie_list

初始化 npm

npm init -y

安裝套件

npm install -D express nodemon

建立 express 伺服器

touch app.js
const express = require('express')

const const app = express()
const port = 8081

app.get('/', (req, res) => {
	res.send('This is the movie list built with express.')
})

app.listen(port)
console.log(`The server is running on localhost:${port}`)

啟動伺服器

nodemon app.js