-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
36 lines (26 loc) · 781 Bytes
/
server.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
const express = require('express');
const { json } = require('micro');
const { ApolloServer } = require('apollo-server-express');
// const {bodyparser} = require('body-parser');
const { typeDefs } = require('./schema.js');
const {resolvers } = require('./resolver.js');
// const {fakedata} = require('./Fakedata.js')
async function f(){
var body = await server.start();
// $.response.setBody(body);
};
const app = express();
const server = new ApolloServer({typeDefs, resolvers});
f();
server.applyMiddleware({ app });
app.listen({port: 3000}, () =>
{
const callbackfuncy = value=>console.log(value+50);
function myfunc(callbackfunc)
{
let value = 50;
callbackfunc(50);
};
// myfunc((val)=>console.log(3+val));
myfunc(callbackfuncy );
}) ;