Skip to content

Commit

Permalink
Add license info
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schüth committed Mar 27, 2017
1 parent 349eda1 commit 81231ff
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
import com.gentics.mesh.graphql.context.impl.GraphQLContextImpl;
import com.gentics.mesh.rest.Endpoint;

import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import io.vertx.ext.web.handler.StaticHandler;

@Singleton
public class GraphQLEndpoint extends AbstractProjectEndpoint {

private static final Logger log = LoggerFactory.getLogger(GraphQLEndpoint.class);

private GraphQLHandler queryHandler;

public GraphQLEndpoint() {
Expand All @@ -43,22 +47,31 @@ public void registerEndPoints() {
queryHandler.handleQuery(gc, body);
});

log.info("GraphiQL is owned and developed by Facebook, Inc. - Copyright (c) 2015, Facebook, Inc. All rights reserved.");
StaticHandler staticHandler = StaticHandler.create("graphiql");
staticHandler.setDirectoryListing(false);
staticHandler.setCachingEnabled(false);
staticHandler.setIndexPage("index.html");
route("/browser/*").method(GET).handler(staticHandler);
route("/browser/*").method(GET)
.handler(staticHandler);

// Redirect handler
route("/browser").method(GET).handler(rc -> {
if ("/browser".equals(rc.request().path())) {
rc.response().setStatusCode(302);
rc.response().headers().set("Location", rc.request().path() + "/");
rc.response().end();
} else {
rc.next();
}
});
route("/browser").method(GET)
.handler(rc -> {
if ("/browser".equals(rc.request()
.path())) {
rc.response()
.setStatusCode(302);
rc.response()
.headers()
.set("Location", rc.request()
.path() + "/");
rc.response()
.end();
} else {
rc.next();
}
});

}

Expand Down
26 changes: 26 additions & 0 deletions verticles/graphql/src/main/resources/graphiql/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
LICENSE AGREEMENT For GraphiQL software

Facebook, Inc. (“Facebook”) owns all right, title and interest, including all
intellectual property and other proprietary rights, in and to the GraphiQL
software. Subject to your compliance with these terms, you are hereby granted a
non-exclusive, worldwide, royalty-free copyright license to (1) use and copy the
GraphiQL software; and (2) reproduce and distribute the GraphiQL software as
part of your own software (“Your Software”). Facebook reserves all rights not
expressly granted to you in this license agreement.

THE SOFTWARE AND DOCUMENTATION, IF ANY, ARE PROVIDED "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE) ARE DISCLAIMED. IN NO
EVENT SHALL FACEBOOK OR ITS AFFILIATES, OFFICES, DIRECTORS OR EMPLOYEES BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THE SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

You will include in Your Software (e.g., in the file(s), documentation or other
materials accompanying your software): (1) the disclaimer set forth above; (2)
this sentence; and (3) the following copyright notice:

Copyright (c) 2015, Facebook, Inc. All rights reserved.
2 changes: 1 addition & 1 deletion verticles/graphql/src/main/resources/graphiql/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
* LICENSE file in the directory of this source tree.
*
-->
<!DOCTYPE html>
Expand Down

0 comments on commit 81231ff

Please sign in to comment.