Giter VIP home page Giter VIP logo

docs's Introduction

Vapor

Documentation Team Chat MIT License Continuous Integration Code Coverage Swift 5.7+ Mastodon


Vapor is an HTTP web framework for Swift. It provides a beautifully expressive and easy-to-use foundation for your next website, API, or cloud project.

Take a look at some of the awesome stuff created with Vapor.

💧 Community

Join the welcoming community of fellow Vapor developers on Discord.

🚀 Contributing

To contribute a feature or idea to Vapor, create an issue explaining your idea or bring it up on Discord.

If you find a bug, please create an issue.

If you find a security vulnerability, please contact [email protected] as soon as possible.

💛 Sponsors

Support Vapor's development by becoming a sponsor.

Broken Hands Emerge Tools Jari Donut Dane MacStadium

💚 Backers

Support Vapor's development by becoming a backer.

Moritz LangMaarten EngelsThomas KrajacicJesse TiptonSteve HumeMikkel UlstrupGeoffrey FosterPaul SchmiedmayerScott RobbinsSven A. SchmidtSpencer CurtisZach RausnitzTim „Timinator“ KretzschmarKlaasAndrew Edwards+Li, Inc.Stijn WillemsKyle NewsomeVia Aurelia SolutionsJakub KiermaszBrian DrellingMattes MohrJamieGalen RhodesLitmapsDavid RomanBrian StrobachKishikawa KatsumiAlex SherbakovSidetrackGreg KarpatiFrantišek MikšJeremy GreenwoodRay FixMićo MiloložaAlanJonas SannewaldTapEnvy.us, LLCJawadPARAIPAN SORINKalyn DavisYR ChenAarón Martínez Cuevas

docs's People

Contributors

0xtim avatar aikrice avatar alemohamad avatar bennydebock avatar brettrtoomey avatar casperhr avatar ckd avatar courteouselk avatar craz1k0ek avatar dolphinsue319 avatar fananek avatar gwynne avatar hailong avatar jacostaf10 avatar jdmcd avatar jhonnybillm avatar joannis avatar joncox avatar joscdk avatar lloople avatar loganwright avatar mattesmohr avatar maxdesiatov avatar natebird avatar ptoffy avatar redsun avatar revolter avatar tanner0101 avatar thenortheestern avatar yasumoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

Unable to install vapor

dyld: Library not loaded: @rpath/libswiftCoreFoundation.dylib
Referenced from: /usr/local/bin/vapor
Reason: image not found
Abort trap: 6

link to learn swift resources

getting started docs should also link to some general swift learning resources where possible. for this issue, a link to the swift book on getting started page would be nice.

Doc for commands

Both explanation of how to build one
How to register it with droplet
How to run the command

Async clarifications

Clarify that the libraries are not thread safe and require being run on a single thread.

preparation docs

Outline creating Preparations outside of just those that come with creating Models.

Resource Controller HTTP methods

Hi, I am trying to figure out what are the HTTP methods used for each action in a Resource controller as shown here

  var index: Multiple?
    var store: Multiple?
    var show: Item?
    var replace: Item?
    var modify: Item?
    var destroy: Item?
    var clear: Multiple?
    var aboutItem: Item?
    var aboutMultiple: Multiple?

So index and show uses GET. destroy uses DELETE, but how about the others? The documentation could have something like

  var index: Multiple?  // GET
    var store: Multiple?
    var show: Item?  // GET
    var replace: Item?
    var modify: Item?
    var destroy: Item? // DELETE
    var clear: Multiple?
    var aboutItem: Item?
    var aboutMultiple: Multiple?

or a table showing also the resource path i.e

index : GET controller/index
show : GET controller/1
destroy : DELETE controller/1

Update Vapor 2.0 Hello World Documentation

After running the vapor new command for the Hello, World documentation, I can't find the func build(_ builder: RouteBuilder) throws line in the file. Instead I found func setupRoutes() throws. Please update the docs so newbies like me can follow them correctly.

Code results in an ambiguous reference error

I followed the tutorial and at "Content" -> "Request"

router.post("login") { req -> Future<HTTPStatus> in
    return req.content.decode(LoginRequest.self).map(to: HTTPStatus.self) { loginRequest in
        print(loginRequest.email) // [email protected]
        print(loginRequest.password) // don't look!
        return .ok
    }
}

results first in an error that content.decode is using a throw, so it can easily be fixed encapsulating it in a try block.

try {
    router.post("login") { req -> Future<HTTPStatus> in
      return req.content.decode(LoginRequest.self).map(to: HTTPStatus.self) { loginRequest in
          print(loginRequest.email) // [email protected]
          print(loginRequest.password) // don't look!
          return .ok
      }
  }
}

furthermore the closure results in an ambiguous error, because the return value cannot be
determined. So put in a return value for the closure.

return req.content.decode(content: LoginRequest.self).map(to: HTTPStatus) { 
     LoginRequest -> HTTPStatus in
                print(loginRequest.email)
                print(loginRequest.password)
                return .ok
}

But this just descalades the ambiguous reference error and now the ".map" member says its ambiguous. I defined the return type of "decode", but the error persists.

TL;DR:
the official documentation has code which doesn't compile because the return type of HTTPRequestStatus cannot be predetermined by the compiler.

Protocol Model

In my opinion, your written document is too simple, can in detail, such as the use of the Leaf can write a detailed example of this.And feel a lot of places need to update, such as the Model should be obey the RowConvertible agreement now.But in the document or observe NodeInitializable and NodeRepresentable agreement.This is beginning to make me very confused, and learning together with difficulty.

search

Add a search functionality to the docs. Possibly couscous provides an easy way of doing this.

Clear documentation on Nodes

As a fundamental concept within Vapor, references to Node within the documentation (currently) assume an understanding in the context node is being used.

I often find myself wanting to understand more around the concepts and transforms taking place between the request - to - backend representation of Node.

Topics: NodeRepresentable, Node, makeNode

Routing issue: vapor docs url without trailing '/' times out.

The vapor doc URLs https://docs.vapor.codes/2.0/ and https://docs.vapor.codes/3.0/ responds OK.

However, https://docs.vapor.codes/2.0 and https://docs.vapor.codes/3.0 timeout.

After the connections times out, then the URLs that timed out show as https://docs.vapor.codes:8080/2.0/ and https://docs.vapor.codes:8080/3.0/ in the browser navigaton bar.

So, my exiting vapor doc bookmarks (that used to work) needed to be updated with the appended /.

Relocated from vapor/website#17

droplet arguments addition

At https://vapor.github.io/documentation/testing/basic.html there's a following statement made about setting up a Droplet for testing:

Droplet(arguments: ["dummy/path/", "prepare"], ...
The arguments: parameter in our Droplet creation. This is rarely used except for advanced situations, but we'll use it here in testing to ensure that our Droplet doesn't try to automatically serve and block our thread. You can use arguments besides "prepare", but unless you're doing something specific for an advanced situation, these arguments should suffice.

It would be helpful if the documentation here, and also in Droplet initialization, would explicitly make it clear that the 1st argument in that argument list maps to the argv passed into the app (and such the first argument is the executable name – therefore it's just "dummy/path" when you initialize a Droplet in context of tests).

Outdated Validation section

The Validation section of documentation is currently out of date so much that unless I'm doing something horribly wrong when it comes to the code, even the first snippet of code isn't applicable to the current version of the Validation package – I don't think the Valid<Validator> class is contained in the current version of package, is it?

At this point, I am afraid I'm not even sure how to start with this surely important package.

Unclear documentation on DB migrations for SQLite

I tried implementing the prepare method for a custom migration for SQLite. However found the documentation really difficult to follow and ultimately didn't work. I was following the steps outlined under the prepare section in Fluent -> Migrations for Vapor 3.0

The current example for prepare uses MySQLConnection, which I just assumed I can substitute out for SQLiteConnection. However doing so causes a 'SQLiteConnection' has no member 'create' build error.

Thought it maybe a SQLite specific issue, however looking under the Fluent SQLite section just redirects to the more general Fluent -> Migration section.

Would be great to have working documentation on this process! Not sure if this a SQLite specific issue or how this documentation is generalised to all Fluent providers...

I am using Vapor 3.0.0 and FluentSQLite 3.0.0-rc2.2

JWT Documentation for Signers

It appears the example for JWT Signers is a bit outdated. https://github.com/vapor/documentation/blob/master/2.0/docs/jwt/overview.md#custom-signers. @tanner0101 and I had a conversation on slack https://qutheory.slack.com/archives/C0N6LGM0W/p1502385156074524 regarding how the signers should actually work.

The current documentation shows

{
  "signers": [
    {
      "type": "rsa",
      "kid": "1234",
      "algorithm": "rs256",
      "key": "yourkeyhere"
    }
  ]
}

and it should be

{
  "signers": {
    "signer": {
      "type": "rsa",
      "kid": "1234",
      "algorithm": "rs256",
      "key": "yourkeyhere"
    }
  }
}

why `vapor clean` and add`mysql-provider` will display an error

let package = Package(
name: "MyApp",
dependencies: [
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1, minor: 0),
.Package(url: "https://github.com/vapor/mysql-provider.git", majorVersion: 1, minor: 0)
]
)
It's important to vapor clean or vapor build --clean after adding new packages.

I found runningvapor clean, an error will be reported later, missing dependencies, this attempt to use vapor build, there is no mistake.

But add this .Package(url: "https://github.com/vapor/mysql-provider.git", majorVersion: 1, minor: 0)
problems arising from the lack of how to solve other dependencies.?

Of course, I do not understand English... ...

The lack of a dependent?

when i do

  1. let package = Package(
    name: "MyApp",
    dependencies: [
    .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1, minor: 0),
    .Package(url: "https://github.com/vapor/mysql-provider.git", majorVersion: 1, minor: 0)
    ]
    )
  2. vapor build
  3. run xcode app

Display this :

ld: library not found for -lCLibreSSL for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

How can I do? I'm a newbie... ...

Homebrew install command fails

The docs use a bad instruction for installing Vapor via Homebrew:

https://github.com/vapor/documentation/blob/5c7762d89eb66eaa19884d27640770e26304f6af/3.0/docs/install/macos.md

This is the command from the link:

brew install vapor/tap/vapor

When running this, Homebrew fails because it tries to clone a nonexistent repository:

https://github.com/vapor/homebrew-cask

I'm not sure what the correct remedy is, if it's updating the Homebrew script or updating the instructions. I did follow the instructions from Vapor Forums and those worked.

Async instructions are out of date

3.0/docs/async/overview.md

DispatchQueue.global() {
…should read…
DispatchQueue.global(qos: .background).async {
...or...
DispatchQueue.main.async() {

I have a fork that includes a scraper example I was messing around with, but I decided it was maybe too far out of the documentation topic purview to pull, and anyway I'm too dumb to know if this should go on the main thread or a background. https://github.com/EricWVGG/documentation/3.0/docs/async/overview.md

more: https://stackoverflow.com/questions/37805885/how-to-create-dispatch-queue-in-swift-3

Database connection requires return declaration

documentation/3.0/docs/database-kit/overview.md line 59

The closure requires a description of what is being returned. ex.

app.withNewConnection(to: .sqlite) { conn -> Future<SomeModel> in

Worth noting that app.withNewConnection(to:closure:) is useful beyond DatabaseKit. I just had success using it to save to database via Fluent inside of a Command. If a section for Container is ever added, it may make sense to move this there, and refer from DatabaseKit and Fluent. Otherwise, Fluent might benefit from a reference to this page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.