Comments (4)
Using this as a sample, I was able to deploy the api
part of the app.
I created a now.json
file in the project's root:
{
"version": 2,
"builds": [
{ "src": "./api/src/index.js", "use": "@now/node-server" }
],
"routes": [
{ "src": "/.*", "dest": "/api/src/index.js" }
]
}
This is using @now/node-server
which Zeit doesn't seem to really want you to use. I think changes could be made to use @now/node
(my hunch is api/src/index.js
would need to do be set up like an Apollo Lamda function).
If you want to add environmental variables to talk to you can do something like:
{
"version": 2,
"builds": [
{ "src": "./api/src/index.js", "use": "@now/node-server" }
],
"routes": [
{ "src": "/.*", "dest": "/api/src/index.js" }
],
"env": {
"NEO4J_URI": "bolt://localhost: 7687",
"NEO4J_USER": "neo4j",
"NEO4J_PASSWORD": "letmein",
"GRAPHQL_LISTEN_PORT": "4000"
}
}
To get the playground to work when I deployed I also had to update the creation of the ApolloServer
:
// api/src/index.js
const server = new ApolloServer({
context: { driver },
schema: schema,
introspection: true,
playground: true,
});
With these changes, I was able to deploy with now
and connect to a playground that was connected to my sandbox DB.
I was unable to get the routes
in now.json
to do something like have the server run at /api
. This may have something to do with how @now/node-server
works, but I'm not sure.
Because of the issue with nesting deploying the UI part gets a little weird, so I tried making a separate now.json
file in the ui
directory following this guide. Unfortunately, I ran up against this open issue. It looks like a fix may be incoming though.
from grand-stack-starter.
Hi @tmr08c . Is your build of api still running?
I've got as far as building 'successfully' (ie without build errors) (I didn't add a route, but the explorer serves from src/index.js).
The ENV variables only seem to be picked up from the now.json file (which is fine, there is some older documentation from Zeit about passing these and secrets with an -e parameter at build time or apply them after a restart which I haven't tested yet).
But the explorer is not finding the Apollo server. I've tried various configs for initialising and connecting explorer to the api (localhost, 0.0.0.0, 127.0.0.1, the zeit app url). At one point logs suggested the server was exposing port 4000, but before I added the env variables it appeared to be starting on a high port (35***) and now I'm a bit confused about exactly what is happening in this build process, so any pointers welcome.
This is a great project ./ stack and super easy just to fire up with Gitpod and a neo4j sandbox, build and enjoy, all for that lovely 'free' word.
It's a bit of a let down having to bash the brain with config for a third party tool and a world of difference if it was the one click process it could/should/will I'm sure be when I work it out!
Alternatively has anyone built a heroku? (for the server - I would be very happy to keep the front-end separate and sure there are plenty of options for this)
Even more alternatively, [in the rest of my spare time :)] I was thinking to look at a serverless implementation and spin up the server as a firebase cloud function: there are various examples of doing this with express out there, but if anyone's there already with this stack...??
[edit]
Like this maybe: https://github.com/Rusfighter/firegraph
see blog article: https://itnext.io/serverless-graphql-with-free-cdn-in-memory-caching-766c1e29376a
from grand-stack-starter.
Hi folks, this may be fixed based on #58 .
from grand-stack-starter.
Think this is good to go, but I'll double check next week.
from grand-stack-starter.
Related Issues (20)
- Neo4j Community Edition GCP does not come with APOC installed HOT 1
- inferschema not able to create all relations
- Error seeding HOT 2
- Auth Directives not working in api netlify function
- Eslint version issue when running create-grandstack-app using react-ts HOT 1
- Error running npx create-grandstack-app related to failed "Creating scripts configuration..." HOT 1
- Couldn't use GRANDstack Starter properly HOT 3
- Error: Cannot find module 'neo4j-driver/lib/temporal-types' HOT 1
- Authentication with Grandstack starter not working with netlify deploy @neo4j/graphql HOT 1
- yarn create not working (but npx does)
- Users List reports an Error on initial setup HOT 1
- Server responded HTTP. HOT 2
- docker-compose image does not install `graphql` HOT 2
- Docker image seems to require 4.x, but has 3.x HOT 1
- When I try to seed the database I get the error "
- Unknown Bolt protocol version 0
- Why can't I query relationships of neo4j with custom query with cypher using Grandstack?
- Is This Repo Still Being Maintained? HOT 1
- Support Vue.js
- Docker-compose build fix
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grand-stack-starter.