Giter Club home page Giter Club logo

sbwebsite's Introduction

SwiftyBeaver Website

Language Swift 3 Vapor 1.x [SwiftyBeaver 1.x] (https://github.com/SwiftyBeaver/SwiftyBeaver) Slack Status

Source code of swiftybeaver.com powered by server-side Swift 3 with Vapor.

Installation

  1. Install Xcode 8
  2. Download / clone the repository & go into the project folder
  3. Install Vapor: curl -sL toolbox.vapor.sh | bash
  4. Build the project: vapor build
  5. Run the web server: vapor run serve
  6. See the website at http://0.0.0.0:8080/

Content

Used Frameworks / Libs:

Included Custom Middleware:

  • Cache Control (set custom cache control header based on file types)
  • CORS (set cross-origin HTTP request for URL based on file types)
  • Error Page (catches & logs HTTP & system errors, renders error pages)

See the middleware folder for more.

Deployment

The project includes a deployment script and a Linux service file. Please read our dedicated article about how you can deploy a production-ready Vapor web app like this one to Amazon Web Services EC2.



Learn More

Get support via Github Issues, email and our public Slack channel.

License

The Swift source code is released under the MIT License. Every other asset (images, videos, SVG files, etc.), is not allowed to be used without permission.

sbwebsite's People

Contributors

skreutzberger 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

Watchers

 avatar  avatar  avatar

sbwebsite's Issues

Use staticServerMiddleware

Always attach middleware with staticServerMiddleware at droplet instantiation to avoid adding it to config again

fix typos

Send your logging & analytics data from your app securely to the cloud without the need for own servers or backend systems. All data stays fully encrypted on our servers and meets highest compliance regulations due to end-to-end encryption. API, unlimited data & optional on-premise hosting included!

for ​_your_​ own servers

and meets ​_the_​ highest compliance

log request time

with middleware

func respond(to: Request ...) -> Response {
    startTimer()
    let response = try chain.respond(to: request)
    stopTimer()
    return response
}

Redirect from HTTP to HTTPS

This is how it is done with Express.js:

// redirect to HTTPS if on HTTP on Heroku
app.use(function(req, res, next) {
    if (config.env == "production") {
        if(req.headers["x-forwarded-proto"] == "https"){
            next();
        } else {
            res.redirect(301, 'https://'+req.hostname+req.url);
        }
    } else {
        next();
    }
});

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.