Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

multi import Route not support? #168

Closed
Matrix-Zhang opened this issue Mar 18, 2016 · 5 comments
Closed

multi import Route not support? #168

Matrix-Zhang opened this issue Mar 18, 2016 · 5 comments

Comments

@Matrix-Zhang
Copy link

main.dart

import 'dart:io';
import 'package:redstone/redstone.dart' as app;
import 'routes/user.dart';
import 'routes/verify_code.dart';

main(List<String> args) {
  app.setupConsoleLog();
  app.start(address: "0.0.0.0", port: 3000);
}

user.dart

import 'package:redstone/redstone.dart' as app;

@app.Route("/user")
User() => "user";

verify_code.dart

import 'package:redstone/redstone.dart' as app;

@app.Route("/verify_code")
VerifyCode() => "verify_code";

only the first import user route valid...

@Pacane
Copy link
Contributor

Pacane commented Mar 18, 2016

How can it be valid? The method has no body. Also, what are you trying to achieve? I'm not sure

@Matrix-Zhang
Copy link
Author

sorry. there is something wrong when i copy the code.
i want separate many routes to different files such as modules...

@platelk
Copy link
Contributor

platelk commented Mar 19, 2016

Have you tried to put them in a library instead and see if it works ?

@Pacane
Copy link
Contributor

Pacane commented Mar 19, 2016

If I were you, I would use groups they're made for that.

If you don't want to, you can make a library, and have your routes in
different parts of the library.

On Sat, Mar 19, 2016, 9:38 AM Vink notifications@github.com wrote:

Have you tried to put them in a library instead and see if it works ?


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#168 (comment)

@Matrix-Zhang
Copy link
Author

make them to a library is ok

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

No branches or pull requests

3 participants