Skip to content

Emily81926/twitter-api-2020

 
 

Repository files navigation

twitter-api-2020 (BackEnd)

本專案為前端專案提供API

Live DEMO

請點此處前往

image

API文件

本份API文件是利用Apiary撰寫而成,請點此處前往

image

專案設定(利用終端機)

  1. 下載本專案到本地
git clone https://github.com/Emily81926/twitter-api-2020.git
  1. 進入本專案資料夾
cd twitter-api-2020
  1. 安裝所需套件
 npm install
  1. 創建資料庫(利用MySQLWorkbench)
create database ac_twitter_workspace;
  1. 建立table
 npx sequelize db:migrate
  1. 建立種子資料
npx sequelize db:seed:all
  1. 建立.env檔案並設定環境參數(.env.example檔案內有實例)
  2. 啟動伺服器
npm run dev  

nodemon app.js // windows使用者使用這行
  1. 若看到以下字串即代表成功啟動 Example app listening on port 3000!

執行測試(利用終端機)

  1. 創建測試所需資料庫(利用MySQLWorkbench)
create database ac_twitter_workspace_test;
  1. 切換環境
export NODE_ENV=test
  1. 建立table
 npx sequelize db:migrate

4. 測試

npm run test

測試帳號

  • 管理員帳號: root
    管理員密碼: 12345678
  • 一般使用者帳號: user1
    一般使用者密碼: 12345678

開發人員

後端

前端

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%