Added yarn2nix and nixified deps

add-tinkerpop-server
Sam Hatfield 2020-02-05 23:20:08 +00:00
parent dc64b96baf
commit d04f220fa5
Signed by: sehqlr
GPG Key ID: 319F06F39E02DE88
4 changed files with 28 additions and 2 deletions

12
default.nix Normal file
View File

@ -0,0 +1,12 @@
let sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {};
yarn2nix = import sources.yarn2nix { inherit pkgs; };
in with pkgs; with yarn2nix;
rec {
lego-marvel-browser = mkYarnPackage {
name = "lego-marvel-browser";
src = ./.;
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
};
}

View File

@ -22,5 +22,17 @@
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs-channels/archive/c8db7a8a16ee9d54103cade6e766509e1d1c8d7b.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"yarn2nix": {
"branch": "master",
"description": "Generate nix expressions from a yarn.lock file",
"homepage": null,
"owner": "moretea",
"repo": "yarn2nix",
"rev": "9e7279edde2a4e0f5ec04c53f5cd64440a27a1ae",
"sha256": "0zz2lrwn3y3rb8gzaiwxgz02dvy3s552zc70zvfqc0zh5dhydgn7",
"type": "tarball",
"url": "https://github.com/moretea/yarn2nix/archive/9e7279edde2a4e0f5ec04c53f5cd64440a27a1ae.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}

View File

@ -11,5 +11,6 @@
"express": "^4.17.1",
"express-graphql": "^0.9.0",
"graphql": "^14.6.0"
}
},
"bin": "server.js"
}

3
src/index.js → server.js Normal file → Executable file
View File

@ -1,8 +1,9 @@
#!/usr/bin/env node
require('dotenv').config()
const express = require('express')
const graphqlHTTP = require('express-graphql')
const marvel = require('./marvel.js')
const marvel = require('./src/marvel.js')
const app = express()
app.use('/graphql', marvel.graphql)