项目
在 GitHub 查看
bradtraversy/storybooks
关于
支持 Google OAuth 的 Node.js 应用
其他项目实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文StoryBooks
Create public and private stories from your life
This app uses Node.js/Express/MongoDB with Google OAuth for authentication
Setup
- Install dependencies:
npm install
- Create your environment file:
- During install,
postinstallattempts to create.envautomatically from.env.example. - If
.envwas not created, copy.env.exampleto.envmanually.
- Add values to
.env:
PORT=3000
MONGO_URI=mongodb+srv://<username>:<password>@<cluster-url>/<database>?retryWrites=true&w=majority
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
MongoDB URI
Use your MongoDB Atlas connection string for MONGO_URI.
Example:
MONGO_URI=mongodb+srv://appuser:[email protected]/storybooks?retryWrites=true&w=majority
Google OAuth Setup
- In Google Cloud Console, create or select a project.
- Configure the OAuth consent screen.
- Create OAuth 2.0 Client ID credentials (Web application).
- Add an Authorized redirect URI:
http://localhost:3000/auth/google/callback
- Copy the generated Client ID and Client Secret into
.envasGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET.
Run
# Run in development
npm run dev
# Run in production
npm start
探索相关项目
加载中…