text: const Koa = require('koa')
  const InitManager = require('./core/init')
  const parser = require('koa-bodyparser')
  const cors = require('@koa/cors');
  const { ApolloServer, gql } = require('apollo-server-koa')
  const resolvers = require('./app/graphql/resovlers/postResolver')
  const typeDefs = require('./app/graphql/typedefs/post')
  const db = require('./app/service/db')
  const catchError = require('./middlewares/exception')
  
  const app = new Koa()
  
  app.use(cors())
  app.use(catchError)
  app.use(parser({
    'formLimit':'200mb',
    'jsonLimit':'200mb',
    'textLimit':'200mb',
  
  }))
  
  const server = new ApolloServer({
    typeDefs,
    resolvers 
   })
  
   
  InitManager.initCore(app)
  
  server.applyMiddleware({ app })
  
  // async => {
  //   await db.connect()
  //   await app.listen(3000)
  // }
     db.connect()
     app.listen(3000)
  