-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentry.js
37 lines (27 loc) · 1.24 KB
/
entry.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
const express = require("express");
const oneNoteAuth = require("./services/oneNoteAuth");
const oneNoteFunction = require("./services/oneNoteFunctions");
const app = express();
app.get('/api', (req,res)=>{
res.json("connection working!!!")
console.log("api test change 1: to test for layering")
})
app.get('/auth/consent', oneNoteAuth.giveConsent)
app.get('/auth/code', oneNoteAuth.getAccessTokenByUsingCode);
app.get('/refreshtoken', oneNoteAuth.getAccessTokenByRefreshToken);
// Basics
app.get('/Me', oneNoteFunction.getUserDetails)
app.get('/notebooks', oneNoteAuth.authenticate, oneNoteFunction.getAllNotebooks)
// ?notebookId=
app.get('/sections', oneNoteAuth.authenticate, oneNoteFunction.getAllsectionsInNotebook);
// ?sectionId
app.get('/pages', oneNoteAuth.authenticate, oneNoteFunction.getAllPagesInASection)
// ?name
app.post('/createNotebook', oneNoteAuth.authenticate, oneNoteFunction.createOneNoteNotebook);
// ?notebookId & sections = comma seprated vales
app.post('/createsections', oneNoteAuth.authenticate, oneNoteFunction.createSections);
// ?[{sectionId,sectionName}]
app.post('/postPagesToAllSections', oneNoteAuth.authenticate, oneNoteFunction.postPagesToAllSections);
app.listen(8000, ()=>{
console.log("server created!!!")
})