-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
57 lines (42 loc) · 1.48 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//Importing Express / REQ, RES
const express = require("express"); //importing express
const app = express(); // instancing express
//Importing dependencies to configurate server
const http = require('http');
const cors = require('cors');
const bodyParser = require('body-parser')
//Configurating Server
app.use(cors());
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
//Importing moongose /Server
const moongose = require("mongoose");
//Running Server
app.listen(8000);
app.get("/", (req, res) => {
console.log("Server running");
return res.status(200).json({ message: "Server Running" })
});
//Routes
//Register user
const userRegister = require("./controller/authController");
app.use("/api/userauth/", userRegister);
//Login
const userLogin = require("./controller/authController");
app.use("/api/userauth/", userLogin);
//Search User
const userID = require("./controller/authController");
app.use("/api/userauth/", userID);
//Delete User
const userDelete = require("./controller/authController");
app.use("/api/userauth/", userDelete);
//Put - Updating Users Info
const userPut = require("./controller/authController")
app.use("/api/userauth/", userPut);
//Getting crypto currences
const getcryptos = require("./controller/coinGeckApiRoute");
app.use("/api/getcryptos/", getcryptos);
const addInWallet = require("./controller/wallet")
app.use("/api/wallet/", addInWallet);
const getWallet = require("./controller/wallet");
app.use("api/wallet", getWallet);