Add publishing date (#107)
This commit is contained in:
+24
-14
@@ -1,4 +1,4 @@
|
||||
require('newrelic');
|
||||
const newrelic = require('newrelic');
|
||||
import dotenv from 'dotenv';
|
||||
dotenv.config();
|
||||
|
||||
@@ -90,20 +90,30 @@ const context = async ({ req }) => {
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const server = new ApolloServer({
|
||||
typeDefs,
|
||||
resolvers,
|
||||
dataSources,
|
||||
context,
|
||||
introspection: true,
|
||||
plugins: [newRelicPlugin],
|
||||
});
|
||||
try {
|
||||
const server = new ApolloServer({
|
||||
typeDefs,
|
||||
resolvers,
|
||||
dataSources,
|
||||
context,
|
||||
introspection: true,
|
||||
plugins: [newRelicPlugin],
|
||||
formatError: (err) => {
|
||||
console.log('Error (fmt):', err);
|
||||
newrelic.noticeError(err);
|
||||
return err;
|
||||
},
|
||||
});
|
||||
|
||||
await server.listen();
|
||||
await server.listen();
|
||||
|
||||
console.log(
|
||||
'Server is running on http://localhost:4000, ',
|
||||
process.env.ENVIRONMENT_NAME,
|
||||
);
|
||||
console.log(
|
||||
'Server is running on http://localhost:4000, ',
|
||||
process.env.ENVIRONMENT_NAME,
|
||||
);
|
||||
} catch (ex) {
|
||||
newrelic.noticeError(ex);
|
||||
console.error('Got terminal exception:', ex);
|
||||
}
|
||||
}
|
||||
main();
|
||||
|
||||
Reference in New Issue
Block a user