strapi/docs/.vuepress/dist/assets/js/7.e1f45fa9.js
2018-10-05 17:24:17 +02:00

1 line
8.0 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{232:function(t,e,a){"use strict";a.r(e);var s=a(0),r=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("Strapi comes with a convenient command-line tool to quickly get your application scaffolded and running.")]),t._v(" "),t._m(1),t._v(" "),t._m(2),a("p",[t._v("Ask your Strapi Studio credentials to link your new applications on your machine to\nthe Strapi Studio aiming to have a perfect workflow while you build APIs.")]),t._v(" "),a("p",[t._v("Go to "),a("a",{attrs:{href:"http://studio.strapi.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("the Strapi Studio"),a("OutboundLink")],1),t._v(" to start the experience.")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),a("p",[t._v("Start your Strapi application, and enter the Node.js REPL. This means you can access\nand use all of your models, services, configuration, and much more. Useful for trying out\nWaterline queries, quickly managing your data, and checking out your project's runtime configuration.")]),t._v(" "),a("p",[t._v("Note that this command still starts the server, so your routes will be accessible via HTTP and sockets.")]),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),a("p",[t._v("Generate a complete API with controllers, models and routes.")]),t._v(" "),t._m(15),t._v(" "),t._m(16),a("p",[t._v("Output the current globally installed Strapi version.")]),t._v(" "),t._m(17),t._v(" "),t._m(18),t._m(19),t._v(" "),a("p",[t._v("This command can be useful if you were not logged into the Studio or if you\ndidn't have Internet access when you generated your application.")]),t._v(" "),t._m(20),t._v(" "),t._m(21),a("p",[t._v("If you don't want to be logged in to the Strapi Studio anymore.")])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#cli","aria-hidden":"true"}},[this._v("#")]),this._v(" CLI")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"login"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#login","aria-hidden":"true"}},[this._v("#")]),this._v(" Login")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[this._v("$ strapi login\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"create-a-new-project"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-a-new-project","aria-hidden":"true"}},[this._v("#")]),this._v(" Create a new project")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[this._v("$ strapi new "),e("span",{attrs:{class:"token operator"}},[this._v("<")]),this._v("appName"),e("span",{attrs:{class:"token operator"}},[this._v(">")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("Create a new Strapi project in a directory called "),e("code",[this._v("appName")]),this._v(".")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[a("code",[t._v("$ strapi new")]),t._v(" is really just a special generator which runs "),a("code",[t._v("strapi-generate-new")]),t._v(".\nIn other words, running "),a("code",[t._v("$ strapi new <appName>")]),t._v(" is an alias for running\n"),a("code",[t._v("$ strapi generate new <appName>")]),t._v(", and like any Strapi generator, the actual generator module\nwhich gets run can be overridden.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"start-the-server"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#start-the-server","aria-hidden":"true"}},[this._v("#")]),this._v(" Start the server")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[this._v("$ "),e("span",{attrs:{class:"token function"}},[this._v("cd")]),this._v(" "),e("span",{attrs:{class:"token operator"}},[this._v("<")]),this._v("appName"),e("span",{attrs:{class:"token operator"}},[this._v(">")]),this._v("\n$ strapi start\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("Run the Strapi application in the current directory.\nIf "),e("code",[this._v("./node_modules/strapi")]),this._v(" exists, it will be used instead of the globally installed module Strapi.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"access-the-console"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#access-the-console","aria-hidden":"true"}},[this._v("#")]),this._v(" Access the console")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[this._v("$ "),e("span",{attrs:{class:"token function"}},[this._v("cd")]),this._v(" "),e("span",{attrs:{class:"token operator"}},[this._v("<")]),this._v("appName"),e("span",{attrs:{class:"token operator"}},[this._v(">")]),this._v("\n$ strapi console\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("Strapi exposes the same global variables in the console as it does in your application code.\nThis is particularly useful in the REPL. By default, you have access to the Strapi application\ninstance, your models as well as Lodash ("),e("code",[this._v("_")]),this._v(") and Socket.IO ("),e("code",[this._v("io")]),this._v(").")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"generate-an-api"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#generate-an-api","aria-hidden":"true"}},[this._v("#")]),this._v(" Generate an API")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[this._v("$ strapi generate api "),e("span",{attrs:{class:"token operator"}},[this._v("<")]),this._v("apiName"),e("span",{attrs:{class:"token operator"}},[this._v(">")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"print-the-strapi-version"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#print-the-strapi-version","aria-hidden":"true"}},[this._v("#")]),this._v(" Print the Strapi version")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[this._v("$ strapi version\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"link-your-application"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#link-your-application","aria-hidden":"true"}},[this._v("#")]),this._v(" Link your application")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[this._v("$ strapi "),e("span",{attrs:{class:"token function"}},[this._v("link")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("Link an existing application without an "),e("code",[this._v("appId")]),this._v(" to the Strapi Studio.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"logout"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#logout","aria-hidden":"true"}},[this._v("#")]),this._v(" Logout")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-bash extra-class"},[e("pre",{pre:!0,attrs:{class:"language-bash"}},[e("code",[this._v("$ strapi "),e("span",{attrs:{class:"token function"}},[this._v("logout")]),this._v("\n")])])])}],!1,null,null,null);r.options.__file="cli.md";e.default=r.exports}}]);