forked from Stoccoin-Official/Stoccoin-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up website folder structure and updated server.js
This commit establishes the basic folder structure for the website, including folders for static assets, views, and routes. Additionally, the server.js file has been updated to include the necessary dependencies and routing logic for these folders.
- Loading branch information
1 parent
9fc452b
commit a54eeee
Showing
15 changed files
with
1,736 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "stoccoin-website", | ||
"version": "1.0.0", | ||
"description": "Welcome to Stoccoin's GitHub repository! Here, you'll find all the code and resources needed to build and deploy our user-friendly news, trading platform for stocks and cryptocurrencies.", | ||
"main": "server.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Stoccoin-Official/Stoccoin-Website.git" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/Stoccoin-Official/Stoccoin-Website/issues" | ||
}, | ||
"homepage": "https://github.com/Stoccoin-Official/Stoccoin-Website#readme", | ||
"dependencies": { | ||
"axios": "^1.3.4", | ||
"bcrypt": "^5.1.0", | ||
"bootstrap": "^5.2.3", | ||
"cors": "^2.8.5", | ||
"dotenv": "^16.0.3", | ||
"express": "^4.18.2", | ||
"jsonwebtoken": "^9.0.0", | ||
"mongoose": "^7.0.2", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-router-dom": "^6.9.0" | ||
} | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// server.js | ||
|
||
const express = require('express'); | ||
const mongoose = require('mongoose'); | ||
const cors = require('cors'); | ||
const dotenv = require('dotenv'); | ||
|
||
dotenv.config(); | ||
|
||
const app = express(); | ||
|
||
mongoose.connect(process.env.MONGODB_URI, { | ||
useNewUrlParser: true, | ||
useUnifiedTopology: true, | ||
}) | ||
.then(() => { | ||
console.log('Connected to MongoDB'); | ||
}) | ||
.catch((error) => { | ||
console.error('Error connecting to MongoDB:', error); | ||
}); | ||
|
||
app.use(cors()); | ||
app.use(express.json()); | ||
app.use(express.urlencoded({ extended: true })); | ||
|
||
app.listen(process.env.PORT || 5000, () => { | ||
console.log(`Server started on port ${process.env.PORT || 5000}`); | ||
}); |