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

Error: undeclared identifier: 'MediaType' #145

Closed
adrianperreault opened this issue Aug 28, 2022 · 2 comments
Closed

Error: undeclared identifier: 'MediaType' #145

adrianperreault opened this issue Aug 28, 2022 · 2 comments

Comments

@adrianperreault
Copy link

Hi, I'm trying to run:

import json_rpc/rpcserver

var router = newRpcRouter()

router.rpc:
  result = %"Hello"

But I run into: nim-chronos/chronos/apps/http/httpcommon.nim(35, 28) Error: undeclared identifier: 'MediaType'

Thx

@mratsim
Copy link
Contributor

mratsim commented Aug 29, 2022

It seems like we have another generic sandwich issue nim-lang/Nim#11225

In the mean time you can solve that with import httputils for https://github.com/status-im/nim-http-utils/blob/e88e231/httputils.nim#L340-L342

@jangko
Copy link
Contributor

jangko commented Jan 4, 2024

The snippet is super outdated, using this should ok. fixed by #178, closing.

import json_rpc/rpcserver

var router = RpcServer.new()

router.rpc("something") do():
  return %"Hello"

@jangko jangko closed this as completed Jan 4, 2024
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

3 participants