1. 已有命令

mix app.start          # Starts all registered apps
mix app.tree # Prints the application tree
mix archive # Lists installed archives
mix archive.build # Archives this project into a .ez file
mix archive.install # Installs an archive locally
mix archive.uninstall # Uninstalls archives
mix clean # Deletes generated application files
mix cmd # Executes the given command
mix compile # Compiles source files
mix deps # Lists dependencies and their status
mix deps.clean # Deletes the given dependencies' files
mix deps.compile # Compiles dependencies
mix deps.get # Gets all out of date dependencies
mix deps.tree # Prints the dependency tree
mix deps.unlock # Unlocks the given dependencies
mix deps.update # Updates the given dependencies
mix do # Executes the tasks separated by comma
mix ecto # Prints Ecto help information
mix ecto.create # Creates the repository storage
mix ecto.drop # Drops the repository storage
mix ecto.dump # Dumps the repository database structure
mix ecto.gen.migration # Generates a new migration for the repo
mix ecto.gen.repo # Generates a new repository
mix ecto.load # Loads previously dumped database structure
mix ecto.migrate # Runs the repository migrations
mix ecto.migrations # Displays the repository migration status
mix ecto.rollback # Rolls back the repository migrations
mix escript # Lists installed escripts
mix escript.build # Builds an escript for the project
mix escript.install # Installs an escript locally
mix escript.uninstall # Uninstalls escripts
mix format # Formats the given files/patterns
mix gettext.extract # Extracts translations from source code
mix gettext.merge # Merge template files into translation files
mix help # Prints help information for tasks
mix hex # Prints Hex help information
mix hex.audit # Shows retired Hex deps for the current project
mix hex.build # Builds a new package version locally
mix hex.config # Reads, updates or deletes local Hex config
mix hex.docs # Fetches or opens documentation of a package
mix hex.info # Prints Hex information
mix hex.organization # Manages Hex.pm organizations
mix hex.outdated # Shows outdated Hex deps for the current project
mix hex.owner # Manages Hex package ownership
mix hex.publish # Publishes a new package version
mix hex.repo # Manages Hex repositories
mix hex.retire # Retires a package version
mix hex.search # Searches for package names
mix hex.user # Manages your Hex user account
mix loadconfig # Loads and persists the given configuration
mix local # Lists local tasks
mix local.hex # Installs Hex locally
mix local.phoenix # Updates Phoenix locally
mix local.phx # Updates the Phoenix project generator locally
mix local.public_keys # Manages public keys
mix local.rebar # Installs Rebar locally
mix new # Creates a new Elixir project
mix phoenix.gen.html # Generates controller, model and views for an HTML based resource
mix phoenix.new # Creates a new Phoenix v1.3.2 application
mix phoenix.server # Starts applications and their servers
mix phx.digest # Digests and compresses static files
mix phx.digest.clean # Removes old versions of static assets.
mix phx.gen.channel # Generates a Phoenix channel
mix phx.gen.context # Generates a context with functions around an Ecto schema
mix phx.gen.embedded # Generates an embedded Ecto schema file
mix phx.gen.html # Generates controller, views, and context for an HTML resource
mix phx.gen.json # Generates controller, views, and context for a JSON resource
mix phx.gen.presence # Generates a Presence tracker
mix phx.gen.schema # Generates an Ecto schema and migration file
mix phx.gen.secret # Generates a secret
mix phx.new # Creates a new Phoenix v1.3.2 application
mix phx.new.ecto # Creates a new Ecto project within an umbrella project
mix phx.new.web # Creates a new Phoenix web project within an umbrella project
mix phx.routes # Prints all routes
mix phx.server # Starts applications and their servers 帮助命令使用:
比如:
mix help mix phx.gen.json

2. 查看路由(方便进行功能的实现)

mix  phx.routes

参考:

Generated hello app
page_path GET / Hello.PageController :index
page_path GET /index/:name Hello.PageController :appdemo
user_path GET /user/:name Hello.UserController :index
demo_path GET /api/demo Hello.DemoController :index
demo_path GET /api/demo Hello.DemoController :index
demo_path GET /api/demo/:id/edit Hello.DemoController :edit
demo_path GET /api/demo/new Hello.DemoController :new
demo_path GET /api/demo/:id Hello.DemoController :show
demo_path POST /api/demo Hello.DemoController :create
demo_path PATCH /api/demo/:id Hello.DemoController :update
PUT /api/demo/:id Hello.DemoController :update
demo_path DELETE /api/demo/:id Hello.DemoController :delete
3. 生成脚手架代码 (phx.gen 开头的)
mix phx.gen.json Accounts User users --table cms_users
4. 生产环境构建
phoenix 依赖

mix deps.get --only prod
MIX_ENV=prod mix compile 资源(web) brunch build --production (构建)
mix phx.digest (压缩) 启动 PORT=4001 MIX_ENV=prod mix phx.server or PORT=4001 MIX_ENV=prod iex -S mix phx.server or 守护进程模式 MIX_ENV=prod PORT=4001 elixir --detached -S mix do compile, phx.server
5. 几个问题
因为新版phoenix 脚手架创建web 的目录已经调整到了lib目录 <app>_web 命名,使用旧版本的代码可能需要调整
如下图:
v1.3 之前的
 
v1.3 以及最新版本
 
6. 参考资料
https://hexdocs.pm/phoenix/deployment.html
https://hexdocs.pm/phoenix/phoenix_mix_tasks.html
 
 
 
 

phoenxi elixir 框架几个方便的命令的更多相关文章

  1. [渣译文] 使用 MVC 5 的 EF6 Code First 入门 系列:MVC程序中实体框架的连接恢复和命令拦截

    这是微软官方教程Getting Started with Entity Framework 6 Code First using MVC 5 系列的翻译,这里是第四篇:MVC程序中实体框架的连接恢复和 ...

  2. MVC程序中实体框架的连接恢复和命令拦截

    MVC程序中实体框架的连接恢复和命令拦截 这是微软官方SignalR 2.0教程Getting Started with Entity Framework 6 Code First using MVC ...

  3. Scrapy框架——介绍、安装、命令行创建,启动、项目目录结构介绍、Spiders文件夹详解(包括去重规则)、Selectors解析页面、Items、pipelines(自定义pipeline)、下载中间件(Downloader Middleware)、爬虫中间件、信号

    一 介绍 Scrapy一个开源和协作的框架,其最初是为了页面抓取 (更确切来说, 网络抓取 )所设计的,使用它可以以快速.简单.可扩展的方式从网站中提取所需的数据.但目前Scrapy的用途十分广泛,可 ...

  4. 为什么安装beego和框架的失败 以及常用命令

    1.安装了几个版本,版本之间相互影响. 把没用的删掉 2.网上找的教程存在问题. 都是相互抄袭.最权威的还是官网. which go rm -rf test/ echo path 获取路径 vim ~ ...

  5. Spring boot框架项目,使用maven命令将配置文件打包到jar包外,项目运行读取jar外配置文件

    1.1      在eclipse中配置maven命令 Mvn -e clean package -Ptest -DskipTests=true 1.1.1    执行命令之后得到jar 1.2    ...

  6. flask框架(八)—自定义命令flask-script、多app应用、wtforms表单验证、SQLAIchemy

    自定义命令flask-script 用于实现类似于django中 python3 manage.py runserver ...类似的命令,用命令行启动项目 首先安装:pip3 install fla ...

  7. django框架常用的数据库迁移命令

    python manage.py makemigrations 默认所有修改过的model层转为迁移文件 python manage.py migrate   默认将所有的迁移文件都执行,更新数据库 ...

  8. im-chooser重新选择输入法框架在终端执行im-chooser命令

    CentOS 7安装图像桌面.Ibus拼音输入法一.图形桌面安装1.安装额外包yum源(extra package for Enterprise Linux) yum install epel-rel ...

  9. PHP框架 Yii framework 用yiic命令时提示“php.exe”不是内部或外部命令

    解决方案 yii/framework/yiic.bat,修改 if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exei ...

随机推荐

  1. IdentityServer4在Asp.Net Core中的应用(三)

    今天的内容是授权模式中的简化模式,还是先看以下授权流程图: 在这种模式中我们将与OpenID结合使用,所以首先我们要了解OpenID和OAuth的区别,关于他们的区别,在我上一篇博客<理解Ope ...

  2. windows service 2008 内存吃尽解决方案

    最近用windows2008,发现系统运行一段时间后,内存吃紧,赶紧打开资源查看器,发现当前运行的程序占有内存都很小,后经查资料,原来是被windows2008的文件缓存吃尽了,这是windows20 ...

  3. 设计模式--适配器模式C++实现

    适配器模式C++实现 1定义Adapter 将一个类的接口变成客户端所需要的另外一种借口,从而使远不因为接口不匹配而无法合作的两个雷能够一起工作 又叫变压器模式,包装模式Wrapper 2类图 角色分 ...

  4. flask学习(七):URL反转

    1. 什么叫反转URL:从视图函数到url的转换叫做反转url 2. 反转url的用处: 1) 在页面重定向的时候,会使用url反转 2) 在模板中,也会使用url反转 3. 实例: 打印出了url

  5. 转载:【Oracle 集群】RAC知识图文详细教程(三)--RAC工作原理和相关组件

    文章导航 集群概念介绍(一) ORACLE集群概念和原理(二) RAC 工作原理和相关组件(三) 缓存融合技术(四) RAC 特殊问题和实战经验(五) ORACLE 11 G版本2 RAC在LINUX ...

  6. 通过消费者和生产者的多线程程序,了解Java的wait()和notify()用法

    仓库类 public class Store { private int size = 0;//当前容量 private final int MAX = 10;//最大容量 //向仓库中增加货物 pu ...

  7. 解决chrome报Not allowed to load local resource错误的方法

    最近项目中遇到了关于图片的更改->保存->本地读取 在本地读取的环节上面出现了错误,一开始用的是直接本地路径,但是在页面上调试的出现了下面的错误,他的路径还是相对路径,下图所示: Goog ...

  8. 报错:Type mismatch: cannot convert from Object to Car

    问题描述: 一个非常简单的spring项目,用静态工厂方法配置bean实例.项目的目录结构如下: 代码如下: Car.java package com.tt.spring.beans.factory; ...

  9. 防火墙---iptables

    一.iptables的说明及环境安装 (1)理论基础:当主机收到一个数据包后,数据包先在内核空间中处理,若发现目的地址是自身,则传到用户空间中交给对应的应用程序处理,若发现目的不是自身,则会将包丢弃或 ...

  10. TeamView

    1.TeamView TeamViewer是一个能在任何防火墙和NAT代理的后台用于远程控制,桌面共享和文件传输的简单且快速的解决方案.为了连接到另一台计算机,只需要在两台计算机上同时运行 TeamV ...