Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to use json-server for persisting snippets #20

Open
ghuser opened this issue Jun 11, 2019 · 0 comments
Open

Ability to use json-server for persisting snippets #20

ghuser opened this issue Jun 11, 2019 · 0 comments

Comments

@ghuser
Copy link

ghuser commented Jun 11, 2019

I cloned and run the service on port:3000.
I saw that it tries to save the snippets on port 4000, so I started a json-server with a default db {snippets:[]}.

Snippets entries are created with id 1,2,3... but the code is not present.
I also see this when clicking on visualize which might be related to not being able to save the code:

Warning: Failed prop type: Invalid prop `shareId` of type `number` supplied to `_class`, expected `string`.
    in _class (at index.js?entry:182)
    in _class (created by Container)
    in AppContainer (created by Container)
    in Container (created by App)
    in div (created by App)
    in App

Current entries on http://localhost:4000/snippets/

[
  {
    "isShared": true,
    "id": 1
  },
  {
    "isShared": true,
    "id": 2
  },
  {
    "isShared": true,
    "id": 3
  }
]

Would be nice to fix this or propose any other back-end for snippets.

FYI: As a workaround I tried to run json-server with shareId as identifier:
json-server -p4000 -w db.json -i shareId
In this case, every new snippet is saved on the server when I press visualize.
For some reason I cannot see the share link button, but if I manually get the newly created shareId then I can visualize correctly (e.g. on http://localhost:3000/v/4 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant