forked from oslabs-beta/QLens
-
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.
working on packaging and distribution
- Loading branch information
1 parent
9162992
commit b3b02ae
Showing
49 changed files
with
17,056 additions
and
631 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react" | ||
] | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
node_modules/ | ||
node_modules |
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,5 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-react" | ||
] | ||
} |
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 @@ | ||
node_modules/ |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
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
File renamed without changes.
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,51 @@ | ||
(function() { | ||
const express = require('express'); | ||
const path = require('path'); | ||
const app = express(); | ||
const cors = require('cors'); | ||
const fs = require('fs'); | ||
const { graphqlHTTP } = require('express-graphql'); | ||
const schemaRoute = require('./schema'); | ||
|
||
const mongoSchemaController = require('./controllers/mongoSchemaController'); | ||
|
||
|
||
app.use(express.json()); | ||
app.use(cors()); | ||
|
||
// Getting mongodb uri from Frontend | ||
app.post('/getURI', mongoSchemaController.createMongoSchema); | ||
|
||
app.post( | ||
'/selectedSchemas', | ||
schemaRoute.converter.migrateSchema, | ||
(req, res) => { | ||
res.status(200).json({ | ||
types: res.locals.types, | ||
queries: res.locals.queries, | ||
mutation: res.locals.mutations, | ||
mongoSchema: res.locals.mongoSchema, | ||
}); | ||
app.use( | ||
'/graphql', | ||
graphqlHTTP({ schema: res.locals.convertedSchema, graphiql: true }) | ||
); | ||
} | ||
); | ||
|
||
// global error handler ---> | ||
app.use((err, req, res, next) => { | ||
const defaultErr = { | ||
log: 'Express error handler caught unknown middleware error', | ||
status: 500, | ||
message: { err: 'An error occurred' }, | ||
}; | ||
const errorObj = Object.assign({}, defaultErr, err); | ||
console.log(errorObj.log); | ||
return res.status(errorObj.status).json(errorObj.message); | ||
}); | ||
|
||
|
||
app.listen(3000, () => console.log('listening on port 3000')); | ||
module.exports = app; | ||
})() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.