Jump to content

IElite

Members
  • Content Count

    1,176
  • Joined

  • Last visited

  • Days Won

    8

IElite last won the day on December 18 2018

IElite had the most liked content!

About IElite

  • Rank

Contact Methods

  • Website URL
    https://www.facebook.com/holmesshanea

Profile Information

  • Gender
    Male
  • Interests
    FreePascal, Delphi, Smart Mobile Studio

Business

  • Company name
    Cold River Labs
  • Sector
    Information technology
  • Position
    Founder

Smart Mobile Studio

  • Edition
    Professional

Recent Profile Visitors

4,088 profile views
  1. IElite

    Endpoints & Resources ?

    OH OK, Thanks for your help!
  2. IElite

    Endpoints & Resources ?

    @lynkfs thanks, I see how you showed how to parse the Url and handle each case. thanks! not sure I am understanding how data works? I am getting "Content: undefined" in my browser. Can you tell me how the data variant is used?
  3. IElite

    Endpoints & Resources ?

    How do i create an endpoint/resource and call one of the HTTP server functions/verbs (with the endpoint/resource)? I do not see anything in the featured demos that show this. When using JS/Node.js and using Express, I would normally do var express = require('express') var app = express() app.get('/api/programs', function (req, res) { // }); app.delete('/api/programs/:id', function (req, res) { // }); So, when I create a new SMART NodeJS project, where do I do declare the endpoint/resource? unit Unit1; interface uses System.Types, System.Types.Convert, System.Objects, System.Device.Storage, System.Streams, System.Reader, System.Writer, System.JSON, System.IOUtils, SmartNJ.System, SmartNJ.Device.Storage, SmartNJ.Application, SmartNJ.Server.Http; type TNodeProgram = class(TObject) private FServer: TNJHTTPServer; protected procedure HandleServerStarted(Sender: TObject); procedure HandleRequest(Sender: TObject; const Request: TNJHttpRequest; const Response: TNJHttpResponse); public procedure Execute; constructor Create; virtual; destructor Destroy; override; end; implementation constructor TNodeProgram.Create; begin inherited Create; FServer := TNJHTTPServer.Create; FServer.Port := 1881; FServer.OnAfterServerStarted := HandleServerStarted; FServer.OnRequest := HandleRequest; end; destructor TNodeProgram.Destroy; begin FServer.free; inherited; end; procedure TNodeProgram.Execute; begin // Start the server FServer.Start(); end; procedure TNodeProgram.HandleServerStarted(Sender: TObject); begin writelnF('Server listening on port %d', [FServer.port]); end; procedure TNodeProgram.HandleRequest(Sender: TObject; const Request: TNJHttpRequest; const Response: TNJHttpResponse); begin // Just end the request by sending the headers back as a string response.&End(request.Headers.ToString()); end; end.
  4. IElite

    Send an email ?

    Oh ok, so if I upload the project to my server, then it should work?
  5. IElite

    Send an email ?

    Not sure I follow you. So the code is not for Browser?
  6. IElite

    Send an email ?

    Sorry, I guess that was the wrong terminology to use. I haven't yet actually tried to send an email. All i have done was to add the all the code you provided above, particularly the smart enabled code. When I run my app , without sending the email, I get that error. I can't delete the scope line because it will complain - as I stated above. Not sure I can also delete the clientId ? Do you think?
  7. IElite

    Send an email ?

    @lynkfs I am trying your "smart" example out above However, it is crashing on this part of the code. If I comment out this entire bit of code, then everything else compiles and runs fine. gapi.client.init(class apiKey = '*****yAlr4k8Qkb8MpbjSbGBIi5h9067lZ4b5Cs'; discoveryDocs = ["https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest"]; clientId = '*****3111041-b3sfpthnis4ofc94d4qg9eo93q9rd7co.apps.googleusercontent.com'; scope = 'https://www.googleapis.com/auth/gmail.send'; end); I am getting this error: Uncaught #<Object> [line #103] Yes, the astrisks are there to mask my keys , i am using my full key and clientId if I comment out the ClientId and Scope, it will also compile and run without errors gapi.client.init(class apiKey = '*****yAlr4k8Qkb8MpbjSbGBIi5h9067lZ4b5Cs'; discoveryDocs = ["https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest"]; //clientId = '*****3111041-b3sfpthnis4ofc94d4qg9eo93q9rd7co.apps.googleusercontent.com'; //scope = 'https://www.googleapis.com/auth/gmail.send'; end); However, if I uncomment just the clientId out of those two, then i get this message: client_id and scope must both be provided to initialize OAuth. [line #71] so, then i uncomment the scope and again, i get the uncaught object error message
  8. IElite

    Node.JS Deprecation Warning

    Kinda figured, just making sure
  9. IElite

    Node.JS Deprecation Warning

    Did you see this ?
  10. IElite

    Renaming form in ObjectInspector

    Your steps worked for me, without error. Both forms are there and both work just fine
  11. IElite

    Websockets OR Node?

    That is what I thought, I guess I misunderstood your previous post thanks
  12. IElite

    Websockets OR Node?

    @jarto - interesting question. Can this be done using just the Client App? If I have my app sitting on our server. If the App uses a JSON file, a user loads the app, the JSON file is served to them using TW3HTTPRequest, But when changes are made, how is the file updated/saved so the next user is able to use the updated JSON information? It was my understanding that you can do any file manipulation using the client?
  13. IElite

    Websockets OR Node?

    I need my web browser app to grab a JSON file from our website and the JSON will eventually be edited/updated within the app and then needs to be to the website and saved/overwritten. Which of these methods would be best? Websockets or Node? I am thinking it probably can only be done with Node?
  14. IElite

    inter-tab processing

    Brilliant!
×