jonataslaw / get_server

A backend server that makes it possible to program with Flutter syntax and reuse existing code
Apache License 2.0
477 stars 42 forks source link

How to start get_server? #25

Closed Hopheylalal closed 3 years ago

Hopheylalal commented 3 years ago

I do not understand how to start get_server and then go to localhost

CpdnCristiano commented 3 years ago

run on the terminal dart lib/main.dart

Bes79 commented 3 years ago

this is not work for me (

dart lib/main.dart
lib/main.dart: Warning: Interpreting this as package URI, 'package:crmdb_server/main.dart'. Unhandled exception:
SignalException: Failed to listen for SIGTERM, osError: OS Error: Такой запрос не поддерживается. , errno = 50

prakash-indorkar commented 3 years ago

Not working for me either... :(

Direct run from vscode.:-


lib/main.dart: Warning: Interpreting this as package URI, 'package:scServer/main.dart'. Unhandled exception:

SocketException: Failed to create server socket (OS Error: An attempt was made to access a socket in a way forbidden by its access permissions. , errno = 10013), address = 0.0.0.0, port = 8080


Using command: "dart lib/main.dart"


lib/main.dart: Warning: Interpreting this as package URI, 'package:scServer/main.dart'. Unhandled exception: SocketException: Failed to create server socket (OS Error: An attempt was made to access a socket in a way forbidden by its access permissions. , errno = 10013), address = 0.0.0.0, port = 8080

0 _NativeSocket.bind (dart:io-patch/socket_patch.dart:770:7)

#1 _RawServerSocket.bind (dart:io-patch/socket_patch.dart:1383:26) #2 _ServerSocket.bind (dart:io-patch/socket_patch.dart:1654:29) #3 ServerSocket._bind (dart:io-patch/socket_patch.dart:1645:26) #4 ServerSocket.bind (dart:io/socket.dart:386:27) #5 _HttpServer.bind (dart:_http/http_impl.dart:2860:25) #6 HttpServer.bind (dart:_http:229:19) #7 GetServer._getHttpServer (package:get_server/src/core/src/server_main.dart:189:25) #8 GetServer.startServer (package:get_server/src/core/src/server_main.dart:115:21) #9 GetServer.start (package:get_server/src/core/src/server_main.dart:107:11) #10 runApp (package:get_server/src/core/src/server_main.dart:12:10) #11 main (package:scServer/main.dart:5:3) #12 _startIsolate. (dart:isolate-patch/isolate_patch.dart:301:19) #13 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12) ________________________________________________________
mjablecnik commented 3 years ago

Can you write here what is your operating system and environment where are you trying start the get_server example? I have Linux Mint 19.3 and after run commands in terminal shell:

git clone git@github.com:jonataslaw/get_server.git
cd get_server/example
flutter packages pub get
dart lib/main.dart

and curl localhost:8080 in other terminal tab it works..

easazade commented 3 years ago

try using dart run lib/main.dart

jonataslaw commented 3 years ago

In the example case, the error occurred because the default port was busy. Just set another port (and open it on the firewall if you have one) and everything will work If you're using windows, try starting dart, or the package compiled as administrator, if you run into problems, and that's all.

ec2-learn-instant commented 5 months ago

Can you please explain the procedure to start the app on different port? @jonataslaw

jonataslaw commented 2 months ago

Yeah, for sure:

GetServer(
    port: 80, // or 8080, or 3000, or whatever you want