Skip to content

Commit

Permalink
Fixes docker dev build
Browse files Browse the repository at this point in the history
  • Loading branch information
swapkats committed Jul 6, 2020
1 parent e2b5faa commit e0fe615
Show file tree
Hide file tree
Showing 5 changed files with 801 additions and 83 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --open",
"compile": "tsc ./server/index.ts && node lib/server/index.js",
"start:server": "forever start lib/server/index.js",
"compile": "ts-node -P tsconfig.json ./server/index.ts",
"start:server": "yarn build:server && pm2 start lib/index.js",
"start:server:watch": "nodemon",
"test": "echo \"Error: no test specified\" && exit 1",
"bundle": "webpack",
"build:server": "tsc --outDir lib server/index.ts",
"type-check": "tsc server/index.ts --noEmit",
"type-check:watch": "yarn type-check -- --watch"
},
Expand Down Expand Up @@ -50,6 +51,7 @@
"neo4j-driver": "^4.1.0",
"neo4j-graphql-js": "^2.14.3",
"nodemon": "^2.0.4",
"pm2": "^4.4.0",
"three": "^0.118.3",
"ts-node": "^8.10.2",
"tsc": "^1.20150623.0"
Expand Down
11 changes: 6 additions & 5 deletions server/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { driver as neo4jDriver } from 'neo4j-driver';
import neo4j from 'neo4j-driver';
// @ts-ignore
import { makeAugmentedSchema } from 'neo4j-graphql-js';
import typeDefs from './typeDefs';

const { ApolloServer } = require('apollo-server');

const schema = makeAugmentedSchema({ typeDefs });
const dbDriver = neo4jDriver('bolt://localhost:7687');
const server = new ApolloServer({ schema, context: { dbDriver } });
const driver = neo4j.driver('bolt://localhost:7687');
const server = new ApolloServer({ schema, context: { driver } });

server.listen(5000, '0.0.0.0').then(({ url }) => {
console.log(`GraphQL API ready at ${url}`);
server.listen(5000, '0.0.0.0').then((_: { url: string}) => {
console.log(`GraphQL API ready at ${_.url}`); // eslint-disable-line
});
3 changes: 3 additions & 0 deletions server/typeDefs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"use strict";
exports.__esModule = true;
exports["default"] = "\ntype Map {\n root: String\n nodes: [NODE] @relation(name: \"HAS_NODE\", direction: \"OUT\")\n}\ntype NODE {\n text: String\n nodes: [NODE] @relation(name: \"HAS_NODE\", direction: \"OUT\")\n}\n";
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "lib", /* Redirect output structure to the directory. */
// "outDir": "lib", /* Redirect output structure to the directory. */
// "rootDir": "server", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
"noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
Expand Down
Loading

0 comments on commit e0fe615

Please sign in to comment.